循环阅读程序1
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
阅读如下程序,提交它的输出结果(请不要提交代码。请只提交阿拉伯数字或字符串的输出结果)。
#include <bits/stdc++.h>
using namespace std;
int main() {
int a = 1;
for (int i = 1; i <= 3; i++) {
a += i;
if (a % 2 == 0) {
a /= 2;
} else {
a = a * 2 + 1;
}
printf("i: %d, a: %d\n", i, a); // 相当于cout << "i: " << i << ", a: " << a << endl;
}
cout << a;
return 0;
}