hdu oj1092题解
#include <iostream>
using namespace std;
int main()
{
int n,i,sum;
int a,b;
while(cin>>i)
{
sum=0;
if(i==0)break;//若i==0,则跳出循环
//cin>>n;
for(a=1;a<=i;a++)
{
cin>>b;
sum+=b;
}
cout<<sum<<endl;
}
return 0;
}
using namespace std;
int main()
{
int n,i,sum;
int a,b;
while(cin>>i)
{
sum=0;
if(i==0)break;//若i==0,则跳出循环
//cin>>n;
for(a=1;a<=i;a++)
{
cin>>b;
sum+=b;
}
cout<<sum<<endl;
}
return 0;
}