You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* while 循环(两次更新) */
int WhileLoopII(int n) {
int res = 0;
int i = 1; // 初始化条件变量
// 循环求和 1, 2, 4, 5...
while (i <= n) {
res += i;
// 更新条件变量
i += 1;
i *= 2;
}
return res;
}
循环求和注释是否应该是1,4,10...
The text was updated successfully, but these errors were encountered:
循环求和注释是否应该是1,4,10...
The text was updated successfully, but these errors were encountered: