Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a (int nr)
- {int inv=0 ;
- while (nr!=0)
- {
- inv=inv*10+nr%10;
- nr=nr/10;
- }
- return inv;
- }
- int main()
- {int n,e;
- cin>>n;
- e=a(n);
- if (e==n) cout<<"numarul este palindrom";
- else cout<<"numarul nu este palindrom";
- return 0 ;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement