1021 - A+B Problem (II) : Input/Output Practice
Description
计算a+b,0<=a,b<1000。
Input
输入的第一行是一个整数N,后面有N对整数a和b,每对a和b占一行,a,b用空格分开。
Output
每行输出一个a+b的和,顺序与输入对应。
Sample Input
2
1 2
10 20
Sample Output
3
30
HINT
N给出了测试样例数,用for循环处理方便。
#include <stdio.h>
int main()
{
int a[1000],b[1000],N,i;
scanf("%d",&N);
for (i=1;i<=N;i++)
scanf("%d%d",&a[i],&b[i]);
for (i=1;i<=N;i++)
printf("%d\n",a[i]+b[i]);
return 0;
}