#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n; //输入一个整数
int ver = 0; //用来存储翻转后的数
int t = n; //用来记住n
while (t > 0) { //把n翻转
ver = ver * 10 + t % 10;
t /= 10;
}
if (ver == n) {
cout << "yes" << endl;
}
else {
cout << "no" << endl;
}
system("pause");
}
原文:https://www.cnblogs.com/urahyou/p/11143751.html