swift 学习笔记(15)-if语句
发布时间:2020-12-14 06:37:22 所属栏目:百科 来源:网络整理
导读:if 语句 - 条件不用再加() - 非零就是真 不适用了,不能再用简单的非0数字代表真 前面其实已经用过了,还是判断成绩的例子吧. var score = 80 if score 90 { print ( "youxiu" )} else if score 80 { print ( "lianghao" )} else if score 60 { print ( "jige"
if 语句 前面其实已经用过了,还是判断成绩的例子吧. var score = 80
if score > 90 {
print("youxiu")
}else if score > 80 {
print("lianghao")
}else if score > 60{
print("jige")
} (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |