濮阳杆衣贸易有限公司

主頁 > 知識庫 > Lua中關(guān)系運算符的使用教程

Lua中關(guān)系運算符的使用教程

熱門標簽:??谥悄苷Z音電銷機器人好用嗎 昆明電話外呼系統(tǒng)好么 杞縣地圖標注app 外呼系統(tǒng)一天耗費多少流量 艾比利外呼系統(tǒng) 陜西便宜電銷機器人軟件 免費門店地圖標注注冊入駐 電話機器人每天搜索多少次 衡水外呼線路解決

下表列出了所有的Lua語言支持的關(guān)系運算符。假設(shè)變量A持有10和變量B持有20則:

示例

試試下面的例子就明白了所有的Lua編程語言提供的關(guān)系運算符:

復(fù)制代碼 代碼如下:
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

當建立并執(zhí)行上面的程序它會產(chǎn)生以下結(jié)果:

復(fù)制代碼 代碼如下:
Line 1 - a is not equal to b
Line 2 - a is not equal to b
Line 3 - a is not less than b
Line 4 - a is greater than b
Line 5 - a is either less than or equal to  b
Line 6 - b is either greater than  or equal to b

您可能感興趣的文章:
  • Lua中..和#運算符的使用方法
  • Lua中的邏輯運算符使用詳解
  • Lua中算術(shù)運算符的使用示例
  • Lua中的運算符簡明總結(jié)
  • Lua學(xué)習(xí)筆記之運算符和表達式
  • Lua基礎(chǔ)之運算符的使用示例

標簽:泰安 宿遷 營口 南京 西寧 臨滄 昌都

巨人網(wǎng)絡(luò)通訊聲明:本文標題《Lua中關(guān)系運算符的使用教程》,本文關(guān)鍵詞  Lua,中,關(guān)系,運算符,的,使用,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Lua中關(guān)系運算符的使用教程》相關(guān)的同類信息!
  • 本頁收集關(guān)于Lua中關(guān)系運算符的使用教程的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    姚安县| 利川市| 太保市| 安远县| 邻水| 浏阳市| 梁山县| 内乡县| 桃源县| 宜兴市| 靖西县| 宣城市| 邵阳市| 永丰县| 高陵县| 诸城市| 堆龙德庆县| 五华县| 阳泉市| 鄱阳县| 唐河县| 项城市| 邻水| 长葛市| 岳阳县| 营口市| 定襄县| 博乐市| 成武县| 土默特右旗| 密山市| 佛坪县| 上虞市| 新龙县| 衡水市| 酒泉市| 临安市| 自贡市| 仙居县| 洛阳市| 营山县|