Swift 코딩테스트 준비

stride(form: to: by:)

천 원 2022. 5. 18. 10:57

import Foundation

for i in stride(from: 5, to: 0, by: -1){
    print(i) // 5 4 3 2 1 출력
}