import UIKit
//** Loop
for var i in 0..<10 {
print(i)
}
/* This is Error(Do not work)
for var i = 0; i < 10; i++ {
}
*/
var numbers:[Int] = [4, 75, 2, 5, 3]
for var n in numbers {
print(n)
}
//** While
var count: Int = 0
//** 基本的なwhile
/*
while count < 10 {
print(count)
count += 1
}
*/
//** repeatの場合はDo-whileと同様(repeatを先に実行し、while条件に従って判断する)
repeat {
print("not yet")
print(count)
count += 1
}
while count < 10
댓글 없음 :
댓글 쓰기