main.cpp 442 B

12345678910111213141516171819202122
  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. cin >> M;
  8. int val = 0, result = 0;
  9. for (int j = 0;j < M;j ++){
  10. cin >> val;
  11. result += val;
  12. }
  13. cout << result << endl;
  14. if (i != N-1) {
  15. cout << endl;
  16. }
  17. }
  18. }
  19. return 0;
  20. }