import math
a = 5
b = 7
C = 49
c = (a**2)+(b**2)-(2*a*b*(math.cos(C)))
gc = math.sqrt(c)
print(gc)
输出7.27726060671 何时输出类似5.3的东西。任何帮助都将非常感激。
-Cam
答案 0 :(得分:2)
首先需要convert to radians:
尝试:
func textFieldShouldReturn(_ textField: UITextField) -> Bool
{
if let next = self.view.viewWithTag(textField.tag + 1) as? UITextField
{
next.becomeFirstResponder()
}
else
{
textField.resignFirstResponder()
}
return true
}