for(i=2;i<=num/2;i++){}
如何在swift3中编写这个循环,而不使用this循环和重复this循环?
我现在只想为this.But使用for循环,Swift3删除旧的c样式循环。

发布于 2016-12-13 08:54:22
你应该写这个:
for i in stride(from: 2, through: num/2, by: 1)
{
print(i)
}https://stackoverflow.com/questions/41116158
复制相似问题