fork(2) download
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int t;
  9. cin>> t;
  10. for (int i= 0;i<t;i++ )
  11. {
  12. int n;
  13. int suma=0;
  14. cin>>n;
  15. int liczby[n];
  16.  
  17.  
  18. for(int j= 0; j<n;j++)
  19. {
  20. cin>>liczby[j];
  21. suma += liczby[j];
  22. }
  23. cout<<suma<<endl;
  24.  
  25. }
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty