-3
,無法在這個C風格的for循環轉換中迅速3.如何轉換C'style for循環中迅速3
for(i=num; i>=1; i--)
{
}
要轉換上面的for循環中迅速3. 我已經看到類似這樣的各種問題。但無法解決這個問題。 請幫我我是新來的迅速。
,無法在這個C風格的for循環轉換中迅速3.如何轉換C'style for循環中迅速3
for(i=num; i>=1; i--)
{
}
要轉換上面的for循環中迅速3. 我已經看到類似這樣的各種問題。但無法解決這個問題。 請幫我我是新來的迅速。
像這樣:
for i in stride(from: num, through: 1, by: -1) {
}
http://stackoverflow.com/questions/24508592/how-to-iterate-for-loop-in-reverse-order-in-swift – simonWasHere
謝謝它解決了我的問題。 – aadityaa