Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int a (int nr)
  5. {int inv=0 ;
  6. while (nr!=0)
  7. {
  8. inv=inv*10+nr%10;
  9. nr=nr/10;
  10. }
  11. return inv;
  12. }
  13. int main()
  14. {int n,e;
  15. cin>>n;
  16. e=a(n);
  17. if (e==n) cout<<"numarul este palindrom";
  18. else cout<<"numarul nu este palindrom";
  19. return 0 ;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement