Advertisement
Gireada

Tema 8 Info exer 6

Nov 19th, 2012
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. II
  2. 6.
  3. #include<iostream.h>
  4. #include<conio.h>
  5.  
  6. int main()
  7. {unsigned a,b,c,d,s,p;
  8. cout<<"Introdu a";cin>>a;
  9. b=0;s=1;p=1;d=a;
  10. while(a!=0)
  11. {
  12.            if(a%10!=0)
  13.            {
  14.                 b=b+(a%10)*p;
  15.                 p=p*10;
  16.            }
  17.            a=a/10;
  18. }
  19. if(d==b)
  20. {
  21.         cout<<"DA";
  22. }
  23. else
  24. {
  25.        cout<<"NU";
  26. }            
  27. getch();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement