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