mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-10 22:15:57 +08:00
@@ -1,23 +1,20 @@
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
int main() {
|
||||
int num;
|
||||
std::cout << "Enter number = ";
|
||||
std::cin >> num;
|
||||
|
||||
int main()
|
||||
{
|
||||
int num;
|
||||
cout << "Enter number = ";
|
||||
cin >> num;
|
||||
std::string s1 = std::to_string(num);
|
||||
std::string s2 = s1;
|
||||
|
||||
string s1 = to_string(num);
|
||||
string s2 = s1;
|
||||
reverse(s1.begin(), s1.end());
|
||||
|
||||
reverse(s1.begin(), s1.end());
|
||||
if (s1 == s2)
|
||||
std::cout << "true";
|
||||
else
|
||||
std::cout << "false";
|
||||
|
||||
if (s1 == s2)
|
||||
cout << "true";
|
||||
else
|
||||
cout << "false";
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user