Advertisement
STANAANDREY

sb prog 13

Feb 24th, 2022
840
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. ifstream fin("graf.in");
  5. int n, a[51][51];
  6.  
  7. int main() {
  8.     fin >> n;
  9.     for (int i = 1; i <= n; i++) {
  10.         for (int j = 1; j <= n; j++) {
  11.             fin >> a[i][j];
  12.         }
  13.     }
  14.  
  15.     for (int i = 1; i <= n; i++) {
  16.         int sum = 0;
  17.         for (int j = 1; j <= n; j++) {
  18.             sum += a[i][j];
  19.         }
  20.         cout << sum << endl;
  21.     }
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement