swift中的if Swift 的条件语句包含 if 和 switch,循环语句包含 for-in、for``、while 和 do-while,循环/判断条件不需要括号,但循 环/判断体(body)必需括号: let individualScores = [75, 43, 103, 87, 12] var teamScore = 0 for score in individualScores { if score > 50 { teamScore += 3 // 更多教程尽在 http://172.16.4…