21 lines
317 B
C++
21 lines
317 B
C++
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
//回文数
|
|
bool Palindrome(int n) {
|
|
int m = n;
|
|
int s = 0;
|
|
while (m > 0) {
|
|
s = s * 10 + m % 10;
|
|
m /= 10;
|
|
}
|
|
return s == n;
|
|
}
|
|
|
|
int main() {
|
|
int n;
|
|
cin >> n;
|
|
cout << Palindrome(n) << endl;
|
|
return 0;
|
|
} |