A+B Problem (II) : Input/Output Practice

来源:互联网 发布:哪里买淘宝小号 编辑:程序博客网 时间:2024/06/16 09:57

A+B Problem (II) : Input/Output Practice

Time Limit: 1 Sec  Memory Limit:2 MB
Submit: 7424  Solved: 5132
[Submit][Status][Web Board]

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循环处理方便。

Append Code



代码:

#include<stdio.h>int main(){    int N,i,a,b;    scanf("%d",&N);    for(i=0; i<N; i++)    {        scanf("%d %d",&a,&b);        printf("%d\n",a+b);    }}


原创粉丝点击