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.

23 lines
363 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() {
for (int i = 1; i <= 1000; i++) {
if (isHWS(i))
cout << i << endl;
}
return 0;
}