--1.table.sort() am = {"cc","nn","ll","dd"} arr = function () ,#am do print(i..","..am[i]) end end table.sort(am) arr() --2.冒泡排序的另外一种写法 function bubble_sort(array) ,#array- do ,#array-i do ] then tmp = arr…
lua的库文件地址: http://luaforge.net/projects/lua官网 http://lua.org --[[ print string. multiple line comments. like {} in Tcl. ]]-- print ("hello") -- comments of this file. -- variables num = 1 str = "abc" tab = {} d = print -- print type th…
1.#输入a,b,c,d4个整数,计算a+b-c*d的结果 a=input("please input a nimber:") b=input("please input a number:") c=input("please input a number:") d=input("please input a number:") print a+b-c*d 输出结果: please input a nimber:3 pleas…