第28173题 单选题
执行如下C++代码,当输入整数1234时,程序的输出结果是什么?
#include <iostream>
using namespace std;
int main() {
    int n, res = 0;
    cin >> n;
    while(n > 0) {
        res = res * 10 + n % 10;
        n = n / 10;
    }
    cout << res << endl;
    return 0;
}
A

4321

B

1234

C

123

D

432

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析