You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
510 B

#include <bits/stdc++.h>
using namespace std;
//判断回文数
bool isHWS(int num) {
int t = num, ans = 0;
while (t) {
ans = ans * 10 + t % 10;
t /= 10;
}
return ans == num;
}
int main() {
vector<int> nums;
int a = 123454321;
while (a) {
nums.push_back(a % 10); //5 4 3 2 1
a /= 10;
}
int res = 0;
for (int i = 0; i < nums.size(); i++)
res = res * 10 + nums[i];
cout << res << endl;
return 0;
}