Files
python/TangDou/LuoGuBook/5705_2.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

26 lines
380 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int a = 123;
int ans = 0;
while (a) {
ans = ans * 10 + a % 10;
a /= 10;
}
printf("%d", ans);
// //数位分离办法
// while (a) {
// int b = a % 10;
// a /= 10;
// printf("%d", b);
// }
// printf("\n");
return 0;
}