Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int x,z,y;
  6. for(int i=100; i<=999; i++){
  7. y = 0; z = 99; x = i;
  8. do{
  9. y=y*10+x%10;
  10. x=x/100;
  11. } while(x!=0);
  12. while(y*z>0 && y%10==z%10){
  13. y=y/10;
  14. z=z/10;
  15. }
  16. if(y+z==0)
  17. cout<<"1";
  18. else
  19. cout<<"0";
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement