fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t, n, a;
  6. cin >> t;
  7. int suma[t-1];
  8. for(int x = 0 ; x < t ; x++)
  9. {
  10. cin >> n;
  11. for(int z = 0 ; z < n ; z++)
  12. {
  13. cin >> a;
  14. suma[x] = suma[x] + a;
  15. }
  16. }
  17. for(int x = 0 ; x < t ; x++)
  18. {
  19. cout << suma[x] << endl;
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
Standard output is empty