--第3题 利用循环求n的阶乘 --参数检查是否是自然数 function IsNaturalNumber(n) ~= )then return false else return true end end function factorial(n) --参数检查 if(not IsNaturalNumber(n))then print("参数有误") return end --若输入的是0直接返回1 )then end --输入的是正整数 local res = , - do res…
--第4题 输出99乘法表 function PrintMulitiplyTable() , do local res = {} local str = "" , i do res[j] = i * j str = table.concat(res, " ") end print(str) end end PrintMulitiplyTable()…