Advertisement
Josif_tepe

Untitled

Mar 17th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, m;
  7.     cin >> n;
  8.     cin >> m;
  9.    
  10.     int mat[n][m];
  11.    
  12.     for(int i = 0; i < n; i++) {
  13.         for(int j = 0; j < m; j++) {
  14.             cin >> mat[i][j];
  15.         }
  16.     }
  17.    
  18.     for(int i = 0; i < n; i++) {
  19.         int zbir = 0;
  20.         for(int j = 0; j < m; j++) {
  21.             zbir += mat[i][j];
  22.         }
  23.         cout << zbir << endl;
  24.     }
  25.     return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement