Lua if判断语句
score = 62
if score > 60 then
print("及格")
elseif score < 60 then
print("不及格")
else
print("刚好及格")
end


带if的都要加then,判断条件不用加(),elseif是连在一起的

对于所有的非false和nil值,if的判断都是为真,否则为假。也就是说,if 0 也是为真true


首页 我的博客
粤ICP备17103704号