a+b
Your task is to calculate the sum of some integers.
4 1 2 3 4 5 1 2 3 4 5
10 15
这虽然是道水题,但它却是我自己做出来的
#include<stdio.h>
int main()
{
int i;
while(scanf("%d",&i)!=EOF)
{
int sum=0;
for(int n=0;n<i;n++)
{
int a[100];
scanf("%d",&a[n]);
sum+=a[n];
}
printf("%d\n",sum);
}
return 0;
}
永远渴望,大智若愚(stay hungry, stay foolish)