Advertisement
naskedvi

S2 - zad.3

Mar 8th, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int simetrican(int a)
  4. {
  5. int broj=0, cifra, b;
  6. b=a;
  7. while(a!=0)
  8. {
  9. cifra=a%10;
  10. a=a/10;
  11. broj=broj*10+cifra;
  12. }
  13. if(b==broj)
  14. return true;
  15. else return false;
  16. }
  17.  
  18.  
  19. int main()
  20. {
  21. std:: cout<< "Unesite broj: ";
  22. int a;
  23. for(;;)
  24. {
  25. std:: cin>> a;
  26. if(a==0) break;
  27. if(simetrican(a))
  28. std:: cout<< "Broj je simetrican!"<< std:: endl;
  29. else
  30. std:: cout<< "Broj nije simetrican!"<< std:: endl;
  31. }
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement