老人疾病Lua中的循环
1 for 循环
--Lua中 for循环的条件要写在括号⾥
-- for i=v1, v2, v3 do ---v1 初始值 v2 结束值 v3 步长
-- .....低收入证明怎么写
-- end
for i=1, 10, 2do
print(i)
end
>>
1
3
5
7
9
2 while循环
-- while (条件) do
-- ...
--end
n = 10
while (n>1) do人事人才工作总结
print (n)
n = n-2
讲述用英语怎么说end
>>
10
8
咽字组词
6
4
东北特产网2
do
n=10
repeat
print (n)
n = n-2
until (n<2)
松鼠说end
>>
杀破狼3电影
10
8
6
4
2
-
-在上述代码中,until 是⼀个循环代码块,在该代码块中,循环执⾏repeat后的语句,知道until的条件满⾜,跳出循环-- do...end 是另⼀个代码快,该代码块通常⽆实际意义,⼀般被⽤来在块中定义局部变量