Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int reverse(int n){
- int r=0;
- while(n!=0){
- r=r*10+(n%10);
- n=n/10;
- }
- return r;
- }
- int main(){
- int tc,p,q;
- scanf("%d",&tc);
- while(tc--){
- int n,m;
- scanf("%d%d",&n,&m);
- p=reverse(n);
- q=reverse(m);
- printf("%d\n",reverse(p+q));
- }
- }
Add Comment
Please, Sign In to add comment