1. 如果我们程序中参数不确定怎么办? 我们用三个点来表示可变参数
function num(...)
如果有确定的参数,也有不确定的参数,我们就这样来表示
function num(a,b,...)
2. return只能出现在语句的结尾一句,也就是在 end else until 这些语句前.
例如1:
function num(i)
x=i*i*i
return x
end
例如2:
function num(i)
function num(i)
if i==8 then
a="我爱虫虫教学!"
b="我爱我的家人!"
return a,b
else
c="我爱我的祖国!"
return c
end
end
print(num(8))