A+B for Input-Output Practice (II)

来源:互联网 发布:陈宝林最优化答案 编辑:程序博客网 时间:2024/05/21 10:25

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


21 510 20

Example Output


630

代码:

#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;}
原创粉丝点击