pierdziadek

#5 - Informatyka - 16.03.2020

Mar 16th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int suma[100];
  5.  
  6. int main() {
  7.     int t, ilosc;
  8.     cin >> t;
  9.     for(int i = 0; i < t; i++) {
  10.         cin >> ilosc;
  11.         int suma2 = 0;
  12.         for(int j = 0; j < ilosc; j++) {
  13.             cin >> suma2;
  14.             suma[i] = suma[i] + suma2;
  15.         }
  16.     }
  17.     for(int i = 0; i < t; i++) {
  18.         cout << suma[i] << endl;
  19.     }
  20.  
  21.  
  22.     return 0;
  23. }
Add Comment
Please, Sign In to add comment