Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int liczbaZbiorow, n, col=0, row=0; cin >> liczbaZbiorow;
- for(int i = 0; i < liczbaZbiorow; i++) {
- cin >> n;
- int tab[n][n];
- for(int j = 0; j < n; j++) for(int k = 0; k < n; k++) cin >> tab[k][j];
- while(col < n) if(tab[row][col] == 1) col++; else row++;
- cout << row + 1 << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement