Sync the while loop in iteration.cs with other languages (#746)
This commit is contained in:
parent
d5bac12f60
commit
9b8625d741
@ -36,9 +36,9 @@ public class iteration {
|
||||
// 循环求和 1, 2, 4, 5...
|
||||
while (i <= n) {
|
||||
res += i;
|
||||
i += 1; // 更新条件变量
|
||||
res += i;
|
||||
i *= 2; // 更新条件变量
|
||||
// 更新条件变量
|
||||
i += 1;
|
||||
i *= 2;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user