swift中的if语句 没有oc中非0即真的概念 let a = 10 if a == 0{ //条件必须是Bool print(a) }else{ print("a不是0") } 三目运算符 let result = a == 10 ? 1 : 0