2019-02-10 14:40:29 +08:00
|
|
|
#include <iostream>
|
|
|
|
#include <algorithm>
|
|
|
|
|
2018-10-31 02:35:32 +08:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2019-02-10 14:40:29 +08:00
|
|
|
int num;
|
|
|
|
cout << "Enter number = ";
|
|
|
|
cin >> num;
|
2018-10-31 02:35:32 +08:00
|
|
|
|
2019-02-10 14:40:29 +08:00
|
|
|
string s1 = to_string(num);
|
|
|
|
string s2 = s1;
|
2018-10-31 02:35:32 +08:00
|
|
|
|
2019-08-21 10:10:08 +08:00
|
|
|
reverse(s1.begin(), s1.end());
|
2018-10-31 02:35:32 +08:00
|
|
|
|
2019-08-21 10:10:08 +08:00
|
|
|
if (s1 == s2)
|
|
|
|
cout << "true";
|
2019-02-10 14:40:29 +08:00
|
|
|
else
|
2019-08-21 10:10:08 +08:00
|
|
|
cout << "false";
|
2018-10-31 02:35:32 +08:00
|
|
|
|
2019-02-10 14:40:29 +08:00
|
|
|
return 0;
|
2018-10-31 02:35:32 +08:00
|
|
|
}
|