or、and的使用

来源:互联网 发布:西安聚航网络 编辑:程序博客网 时间:2024/05/29 17:13
local i = 0
local a = 10
local b = 9


if (a > b) or (i == 1) then 
  print("或运算为 真") --
else
  print("或运算为 假")
end
print("i = " .. i) -- i = 0


i = 0
if (a < b) and (i == 1) then
  print("与运算为 真")
else
  print("与运算为 假") --
end
print("i = " .. i) --i = 0