main.cpp 384 B

1234567891011121314151617181920
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int N, M;
  5. while (cin >> N) {
  6. for (int i = 0; i < N; i++) {
  7. int result = 0;
  8. int val;
  9. cin >> M;
  10. for (int j = 0; j < M; j++) {
  11. cin >> val;
  12. result += val;
  13. }
  14. cout << result << endl;
  15. }
  16. }
  17. return 0;
  18. }