Problem A: A+B problem
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 313 Solved: 213
[ Submit][ Status][ Web Board]
Description
Calculate a+b
Input
There are several lines.
The first line contains the number of test cases. In the following, each line contains two integer values seperated by a space.
Output
Output the sum of these values.
Sample Input
3
12345678901 19876543217
54749110547 5474119110
15530259260 130625199010
Sample Output
32222222118
60223229657
146155458270
HINT
These numbers are beyond int types. it will be wrong if you input them directly, so you can use arrays to solve this problem.
#include <stdio.h>
#include <stdlib.h>
int main()
{ int n,i;
long long int s;
scanf("%d",&n);
long long int x[2*n];
for(i=0;i<n;i++){
scanf("\n%lld %lld",&x[2*i],&x[2*i+1]);}
for(i=0;i<n;i++){
s=x[2*i]+x[2*i+1];
printf("%lld\n",s);}
return 0;
}