题解 | 多组_一维数组_T组形式
多组_一维数组_T组形式
https://www.nowcoder.com/practice/90cdc8e31ef74b6e9fd44c1e03077b57
#include <iostream>
using namespace std;
int main() {
int num;
cin >> num;
for (int i = 0; i < num; i++) {
int n;
cin >> n;
int temp;
long sum = 0;
for (int j = 0; j < n; j++) {
cin >> temp;
sum += temp;
}
cout << sum << endl;
}
}
// 64 位输出请用 printf("%lld")
查看16道真题和解析