hdu oj1094题解
#include <iostream>
using namespace std;
int main()
{
int a,b,c,sum;
while (cin>>a)
{
sum=0;
for(b=1;b<=a;b++)//b变量控制循环
{
cin>>c;
sum+=c;
}
cout<<sum<<endl;
}
return 0;
}
using namespace std;
int main()
{
int a,b,c,sum;
while (cin>>a)
{
sum=0;
for(b=1;b<=a;b++)//b变量控制循环
{
cin>>c;
sum+=c;
}
cout<<sum<<endl;
}
return 0;
}