Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- int funk(int n)
- { bool t(true);
- int a(n), cifra(0), nb(1);
- while (a!=0)
- {
- cifra=a%10;
- nb=nb*10+cifra;
- a/=10;
- }
- if (nb!=a) return t;
- }
- int main ()
- {
- int n;
- std::cout<<"Unesite neki broj: ";
- while (std::cin>>n, n!=0)
- {
- if (funk(n)==true) std::cout<<"Uneseni broj je simetrican."<<std::endl;
- else std::cout<<"Broj nije simetrican."<<std::endl;
- return 0;
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement