2013
11-27

# A+B for Input-Output Practice (VI)

Your task is to calculate the sum of some integers.

Input contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.

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.

4 1 2 3 4
5 1 2 3 4 5

10
15

#include<stdio.h>
int main()
{
int a,i,n,sum;
while(scanf("%d",&n)!=EOF)
{
sum=0;
for(i=0;i<n;i++)
{
scanf("%d",&a);
sum+=a;
}
printf("%d/n",sum);
}
}

1. 代码是给出了，但是解析的也太不清晰了吧！如 13 abejkcfghid jkebfghicda
第一步拆分为 三部分 (bejk, cfghi, d) * C(13,3)，为什么要这样拆分，原则是什么？