//: Playground - noun: a place where people can play
import UIKit
//for循环基本写法
for i in 0..<10 {
print(i);
}
//for循环的特殊写法
//如果一个标志符不需要使用,可以用_代替
for _ in 0...10 {
print("hello world");
}
// 9->0 怎么实现?
//倒序
for i in (0..<10).reversed() {
print(i);
}
网友评论