作者:9baibai_555 | 来源:互联网 | 2023-05-17 17:29
HowwouldyouexpressadecrementingindexedloopinSwift3.0,wherethesyntaxbelowisnotvalid
How would you express a decrementing indexed loop in Swift 3.0, where the syntax below is not valid any more?
在Swift 3.0中,如果下面的语法不再有效,您将如何表示一个递减的索引循环?
for var index = 10 ; index > 0; index-=1{
print(index)
}
// 10 9 8 7 6 5 4 3 2 1
5 个解决方案