Guest User

Untitled

a guest
May 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int C,i=1,R1=0,R2=0 ,N1,N2,sum,rev=0;
  7. cin>> C;
  8. while(i>C)
  9. {
  10.  
  11. cin>>N1>>N2;
  12. while(N1!=0)
  13. {
  14. R1=R1*10;
  15. R1=R1+N1%10;
  16. N1=N1/10;
  17. }
  18. while(N2!=0)
  19. {
  20. R2=R2*10;
  21. R2=R2+N2%10;
  22. N2=N2/10;
  23. }
  24. sum=R1+R2;
  25. while(sum!=0)
  26. {
  27. rev=rev*10;
  28. rev=rev+sum%10;
  29. sum=sum/10;
  30. }
  31. cout<<endl<<rev;
  32. i++;
  33. }
  34. return 0;
Add Comment
Please, Sign In to add comment