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