解题思路:
双while
注意事项:
参考代码:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int count;
int k;
int n;
int sum = 0;
cin >> count;
while (count--)
{
while (cin >> k && k)
{
for (int i = 0; i < k; i++)
{
cin >> n;
sum += n;
}
cout << sum << endl;
sum = 0;
break;
}
}
}
0.0分
0 人评分