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.

20 lines
360 B

#include <bits/stdc++.h>
using namespace std;
//判断回文数
bool isHWS(int num) {
int b = num, ans = 0;
while (b) {
ans = ans * 10 + b % 10;
b /= 10;
}
return ans == num;
}
int main() {
int a = 123321;
if (isHWS(a))printf("是回文数!");
else printf("不是回文数!");
return 0;
}