#include <iostream>
#include <stdlib.h>
#include <string>
#include<algorithm>
using namespace std;
//实现回文数
void is_huiwen(string str1)
{
string str2 = str1;
cout << str1 << endl;
cout << str2 << endl;
reverse(str2.begin(), str2.end());
cout << str1 << endl;
cout << str2 << endl;
int he = str1.compare(str2);
if (he == 0)
{
cout << "该数为回文数" << endl;
}
else
{
cout << "该数不是回文数" << endl;
}
}
//将整型转换为字符串
int main()
{
int a;
string str;
cout << "请输入一个数:" << endl;
cin >> a;
cout << endl;
str = to_string(a);
is_huiwen(str);
system("pause");
return 0;
}