SHARE
TWEET

Untitled

a guest Feb 17th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. long int reverse(long int n)
  3. {
  4.     long int ans=0;
  5.     if(n==0)
  6.   {
  7.     return 0;
  8.   }
  9.     while(n>0)
  10.     {
  11.         ans = ans*10+(n%10);
  12.         n = n/10;      
  13.     }
  14.     return ans;
  15. }
  16. int main(void) {
  17.     int n;
  18.   long int a,b,s;
  19.     scanf("%d",&n);
  20.     for(int i=0;i<n;i++)
  21.     {
  22.         scanf("%ld%ld",&a,&b);
  23.     s=reverse(a)+reverse(b);
  24.         printf("%ld\n",reverse(s));
  25.     }
  26.     return 0;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top