# A+B 三连

## A+B（一）

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 215  Solved: 143

## Sample Input

1
1 3
2
2 5
11 22

## Sample Output

4
7
33

#include"stdio.h"
int main ()
{
    int n, b, a;
    int c;
    while(~scanf("%d\n",&n))
    {   c=0;
        for(int i=0;i<n;i++)
        {
            scanf("%d %d",&a,&b);

            c=a+b;
            printf("%d\n",c);
        }

    }
    return 0;
}

## A+B(二)

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 200  Solved: 130

## Input

Input contains multiple test cases, and one case one line.

Each case starts with an integer N(1 <= N <= 10000), and then N integers Ai( |Ai| <= 10000) follow in the same line.

## Output

For each test case you should output the sum of N integers in one line, and with one line of output for each line in input.

## Sample Input

4 1 2 3 4
5 1 2 3 4 5


## Sample Output

10
15

#include <iostream>
using namespace std;
int main()
{
int n,i,a,b;
while(scanf("%d",&n)==1)
{
a = 0;
for(i=0;i<n;i++)
{
scanf("%d",&b);
a=a+b;
}
printf("%d\n",a);
}
return 0;
}

## A+B （三）

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 117  Solved: 79

## Input

Input contains an integer N(0 < N <= 100) in the first line, and then N lines follow. Each line starts with a integer M, and then M(0 < M <= 100) integers follow in the same line.

## Output

For each group of input integers you should output their sum in one line, and with one line of output for each line in input.

## Sample Input

2
4 1 2 3 4
5 1 2 3 4 5


## Sample Output

10
15

#include<stdio.h>
int main()
{
    int a, i ,m;
    while(~scanf("%d",&m))
    {
        int b;
        for(i=0;i<m;i++)
        {
            int sum=0;
            int il;
            scanf("%d",&a);
            for(il=1;il<=a;il++)
            {
                scanf("%d",&b);
                sum=sum+b;
            }
            printf("%d\n",sum);
        }
    }
    return 0;
}