Advertisement
Ahmed_Negm

Untitled

Dec 8th, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip>
  3. #include<cmath>
  4.  
  5. // #include <algorithm>
  6. using namespace std;
  7. void Ahmed_Negm(){
  8.   #ifndef ONLINE_JUDGE  
  9.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  10.   #endif
  11. }
  12. int main()
  13. {Ahmed_Negm();
  14.  
  15.  
  16. long long n, rev;
  17. cin>>n;
  18. for(rev = 0; n > 0; n/10){
  19. rev = (rev*10) + (n%10);
  20. }
  21.  
  22. if(rev == n){
  23.   cout<<rev<<"\nYES";
  24. }else{
  25.   cout<<rev<<"\nNO";
  26. }
  27.  
  28.  
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement