您好,欢迎来到品趣旅游知识分享网。
搜索
您的当前位置:首页while和repeat

while和repeat

来源:品趣旅游知识分享网
index = 1
    while index < 10 do
        index = index + 1
    end

    repeat
    	index = index + 1
    until index >= 20

    return index



1.while需要和do一起使用,也是需要end结尾

2.repeat需要和until一起使用,不需要end结尾

3.repeat至少会运行一次,不管index >= 20 ,还是其他值,repeat都会运行一次

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- pqdy.cn 版权所有 赣ICP备2024042791号-6

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务