Advertisement
Guest User

Untitled

a guest
May 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int liczbaZbiorow, n, col=0, row=0; cin >> liczbaZbiorow;
  6.     for(int i = 0; i < liczbaZbiorow; i++) {
  7.         cin >> n;
  8.         int tab[n][n];
  9.         for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) cin >> tab[k][j];
  10.         while(col < n) if(tab[row][col] == 1) col++; else row++;
  11.         cout << row + 1 << endl;
  12.     }
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement