/swift_tutorial

“func​ ​minMax​(​array​: [​Int​]) -> (​min​: ​Int​, ​max​: ​Int​) { ​ ​var​ ​currentMin​ = ​array​[​0​] ​ ​var​ ​currentMax​ = ​array​[​0​] ​ ​for​ ​value​ ​in​ ​array​[​1​..<​array​.​count​] { ​ ​if​ ​value​ < ​currentMin​ { ​ ​currentMin​ = ​value ​ } ​else​ ​if​ ​value​ > ​currentMax​ { ​ ​currentMax​ = ​value ​ } ​ } ​ ​return​ (​currentMin​, ​currentMax​) ​}” 抜粋:: Apple Inc. “The Swift Programming Language”。 iBooks. https://itun.es/cn/jEUH0.l

Primary LanguageSwift

Watchers