#include using namespace std; int t[205][205]; #define pozi 2 #define negat 1 inline int elojelvalt(int &i,int &j) { if(t[i][j]==pozi) { if(t[i-1][j]==negat) { i=i-1; return 2; } if(t[i-1][j-1]==negat) { i=i-1; j=j-1; return 3; } if(t[i][j-1]==negat) { j=j-1; return 4; } } else if(t[i][j]==negat) { if(t[i+1][j]==pozi) return 2; if(t[i+1][j+1]==pozi) return 3; if(t[i][j+1]==pozi) return 4; } return 1; } bool meg=0; int keresValt(int a,int b,int c,int d,int &i,int &j) { int x,y,v; x=(c+a)/2; y=(d+b)/2; do { cout<>v; t[x][y]=(v>0)+1; if(v<0) { a=x; b=y; if(a0){ c=x; d=y; if(a=2) { if(v==2) { ker(a,j+1,i,d); if(!meg) ker(i+1,b,c,j-1); } else if(v==3) { ker(a,j+1,i,d); if(!meg) ker(i+1,b,c,j); } else { ker(a,j+1,i-1,d); if(!meg) ker(i+1,b,c,j); } } } } int main() { ker(1,1,200,200); return 0; }