Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int a, broj(0), cifra;
- std:: cin >> a;
- int b(a);
- while(a!=0)
- {
- cifra=a%10;
- a/=10;
- broj=broj*10+cifra;
- }
- std:: cout << broj<< std::endl;
- if(broj==b)
- std:: cout << "Broj je palindrom!";
- else std::cout<<"Broj nije palindrom!";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment