Lua中if语句嵌套的使用教程(if语句的嵌套)速看

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

文章摘要

这篇文章描述了一个使用局部变量和条件判断的简单程序。代码定义了两个局部变量a和b,并使用if语句检查它们的值。如果a等于100且b等于200,则打印特定信息;否则,分别打印a和b的值。最后,程序输出了a和b的精确值。文章通过具体的代码示例,展示了变量赋值、条件判断和结果输出的过程,内容简洁明了,重点突出。

–[ local variable definition –]

a=100;

b=200;

–[ check the boolean condition –]

if( a==100 )

then

   –[ if condition is true then check the following –]

   if( b==200 )

   then

      –[ if condition is true then print the following –]

      print(“Value of a is 100 and b is 200” );

   end

end

print(“Exact value of a is :”, a );

print(“Exact value of b is :”, b );

© 版权声明

相关文章