Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- int matt[35][35],v,h,n=-1;
- bool a=false;
- cin>>v;
- cin.ignore();
- cin>>h;
- cin.ignore();
- for(int i=0;i<h;i++){
- string s;
- getline(cin,s);
- for(int j=0;j<v;j++){
- matt[i][j]=s[j]-'0';}}
- for(int i=0;i<h;i++){
- // cout<<"i"<<endl;
- for(int j=0;j<v;j++){
- cout<<matt[i][j]<<endl;
- if(matt[i][j]==0) //ova
- cout<<endl;
- if(matt[i][j]==0){ //i ova
- cout<<j<<' '<<i<<' ';
- for(int m=j+1;m<v;j++){
- if(matt[i][m]==0){
- a=true;
- cout<<m<<' '<<i<<' ';
- break;
- }
- }
- if(not(a))
- cout<<n<<' '<<n<<' ';
- a=false;
- for(int m=i+1;m<h;m++){
- if(matt[m][j]==0){
- a=true;
- cout<<j<<' '<<m<<endl;
- break;
- }
- }
- if(not(a))
- cout<<n<<' '<<n<<endl;
- a=false;
- }
- else
- a=false;
- }
- }
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement