import UIKit
//** Functions
//** Funtion 定義
func CheckCount () {
var count: Int = 0
while count < 10 {
print(count)
count += 1
}
}
CheckCount()
//** Function Parameter 定義
func CheckCount (message: String) {
var count: Int = 0
while count < 10 {
print(message)
count += 1
}
}
CheckCount(message: "not yet")
//** Parameter値を指定
func CheckCount (message: String, pCount: Int) {
var count: Int = pCount
while count < 10 {
print(message)
count += 1
}
}
CheckCount(message: "not yet2", pCount: 5)
//** Func Return
func CheckCount2 (message: String, pCount: Int) -> String {
var count: Int = pCount
while count < 10 {
print(message)
count += 1
}
return "Done!"
}
print(CheckCount2(message: "Do yet", pCount: 3))
댓글 없음 :
댓글 쓰기