有趣的事

it2025-02-02  7

for i in print, "123" , "368" do end 输入:123 368 function iter (a, i) i = i + 1 local v = a[i] if v then return i, v end end a = {"one", "two", "three"} for i, v in iter, a, 0 do print(i, v) end 输出:1 one 2 two 3 three 注:in会执行放入的函数并将后续变量作为参数传入函数中

转载于:https://www.cnblogs.com/ad-1990/p/4124965.html

最新回复(0)