刚开始 别心急 可以参照别人的代码 但是仙女你一定要自己敲一遍阿!!!
blingbling
#include<iostream>
using namespace std;
int main() {
int N; cin >> N;
while (N--) {
int M,temp,sum = 0;
cin >> M;
while (M--) {
cin >> temp;
sum += temp;
}
if (N > 0)
cout << sum << endl << endl;
else
cout << sum << endl;
}
return 0;
}
原文:http://www.cnblogs.com/fairy-wzp/p/6919458.html