If表达式
if 表达式
if 表达式john_height := 100
maria_height := 178
if john_height < maria_height {
println("Maria is taller than John")
}else 语句
else 语句joey_age := 12
kevin_age := 15
if joey_age > kevin_age {
println("Joey is older")
} else {
println("Kevin is older")
}else if 语句
else if 语句嵌套的 if..else 语句
if..else 语句使用 if..else 表达式
if..else 表达式练习
Last updated
Was this helpful?