提交时间:2024-11-09 09:54:41
运行 ID: 56072
#include <iostream> using namespace std; int reverseNumber(int num) { int reversed = 0; while (num > 0) { reversed = reversed * 10 + num % 10; num /= 10; } return reversed; } int main() { int n; cin >> n; cout << reverseNumber(n) << endl; return 0; }