-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathADDREV.cpp
More file actions
26 lines (26 loc) · 709 Bytes
/
ADDREV.cpp
File metadata and controls
26 lines (26 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include<stdio.h>
int reverse(int *p){
int temp=0;
while(*p>0){
temp=temp*10+(*p%10);
*p/=10;
}
return temp;
}
int main(){
int a,b,c,i;
scanf("%d",&a);
int temp[a];
i=a;
while(a>0){
scanf("%d %d",&b,&c);
temp[a]=reverse(&b)+reverse(&c);
temp[a]=reverse(&temp[a]);
a--;
}
while(i>0){
printf("%d\n",temp[i]);
i--;
}
return 0;
}