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