Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
114098 | 成书骏 | 04四位数移位 | C++ | Wrong Answer | 1 MS | 280 KB | 600 | 2025-03-20 21:42:32 |
#include <iostream> int main() { int a; std::cout << "请输入一个四位数: "; std::cin >> a; if (a >= 1000 && a <= 9999) { int thousands = a / 1000; int hundreds = (a % 1000) / 100; int tens = (a % 100) / 10; int units = a % 10; int newNumber = units * 1000 + thousands * 100 + hundreds * 10 + tens; std::cout << "变换后的数字是: " << newNumber << std::endl; } else { std::cout << "输入的不是四位数,请重新运行程序并输入正确的数字。" << std::endl; } return 0; }
------Input------
6234
------Answer-----
4623
------Your output-----
请输入一个四位数: 变换后的数字是: 4623