Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
114099 | 成书骏 | 04四位数移位 | C++ | Wrong Answer | 0 MS | 276 KB | 570 | 2025-03-20 21:51:56 |
#include <iostream> using namespace std; int main() { int a; cout << "请输入一个四位数: " << endl; cin >> a; if (a >= 1000 && a <= 9999) { int thousand = a / 1000; int hundred = (a / 100) % 10; int ten = (a / 10) % 10; int one = a % 10; int result = one * 1000 + thousand * 100 + hundred * 10 + ten; cout << result << endl; } else{ cout << "输入的不是四位数,请重新运行程序并输入正确的数字。" << endl; } return 0; }
------Input------
6234
------Answer-----
4623
------Your output-----
请输入一个四位数: 4623