学习lua-01,遍历集合,多入参循环处理,类型判断,数字运算
--function maxnum(tab1) -- local b = 1 -- local a = tab1[b] -- for i, v in ipairs(tab1) do -- if v > a then -- a = v -- end -- end -- return a --end --print(maxnum({ 1, 2, 3, 5, 3, 11, 2, 32 })) function compertoNum(...) local a = nal for i, v in ipairs { ... } do a = v print('i->'..i .. ',v->' .. v .. ',a->' .. a) if v > a then a = v end --print('a->'..a) end return a end testMethod = function (param) print("打印- ##",param,"##") end --print(compertoNum(1, 2, 4, 5, 11, 23, 543, 123, 45, 2131, 12))