Lua中关系运算符的使用教程(关系运算符和逻辑运算符的区别)真没想到

随心笔谈2年前发布 编辑
159 0
🌐 经济型:买域名、轻量云服务器、用途:游戏 网站等 《腾讯云》特点:特价机便宜 适合初学者用 点我优惠购买
🚀 拓展型:买域名、轻量云服务器、用途:游戏 网站等 《阿里云》特点:中档服务器便宜 域名备案事多 点我优惠购买
🛡️ 稳定型:买域名、轻量云服务器、用途:游戏 网站等 《西部数码》 特点:比上两家略贵但是稳定性超好事也少 点我优惠购买

a=21

b=10

if( a==b )

then

   print(“Line 1 – a is equal to b” )

else

   print(“Line 1 – a is not equal to b” )

end

if( a ~=b )

then

   print(“Line 2 – a is not equal to b” )

else

   print(“Line 2 – a is equal to b” )

end

if ( a < b )

then

   print(“Line 3 – a is less than b” )

else

   print(“Line 3 – a is not less than b” )

end

if ( a > b )

then

   print(“Line 4 – a is greater than b” )

else

   print(“Line 5 – a is not greater than b” )

end

— Lets change value of a and b

a=5

b=20

if ( a <=b )

then

   print(“Line 5 – a is either less than or equal to  b” )

end

if ( b >=a )

then

   print(“Line 6 – b is either greater than  or equal to b” )

end

© 版权声明

相关文章