#include <iostream> using namespace std; int main() { int x; cin >> x; int a = x / 1000; // 千位 int b = x / 100 % 10; // 百位 int c = x / 10 % 10; // 十位 int d = x % 10; // 个位 int res = d*1000 + c*100 + b*10 + a; cout << res; return 0; }
使用您的 蒙青创OJ 通用账户