您的位置:首页 > 编程语言 > PHP开发

A+B for Input-Output Practice (II)

2017-11-18 15:32 232 查看

A+B for Input-Output Practice (II)

Problem Description

Your task is to Calculate a + b.

Input

Your task is to Calculate a + b.

Output

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.

Example Input

2
1 5
10 20


Example Output

6
30


代码:

#include <stdio.h>
#include <stdlib.h>

int main()
{
int a, b, sum, i, n;
scanf("%d", &n);
for(i = 1; i <= n; i++)
{
scanf("%d%d", &a, &b);
sum = a + b;
printf("%d\n", sum);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: