杭电ACM1096求和问题
最后更新于:2022-04-01 09:47:17
~~~
#include <iostream>
using namespace std;
int main()
{
int n,m,a,sum=0;
while(cin>>n)
{
while (n--)
{
cin>>m;
sum=0;
while (m--)
{
cin>>a;
sum=sum+a;
}
if(n>0)
cout<<sum<<endl<<endl;
else
cout<<sum<<endl;
}
}
return 0;
}
~~~
';