Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program qq;
- var x,y,step:longint;
- ind:boolean;
- count,answ:integer;
- begin
- x:=0; y:=0;
- write(x,' ',y,#13#10);
- read(answ);
- ind:=true;
- step:=1000000000;
- while ind do begin
- repeat //вверх
- if (y+step)<=1000000000 then
- y:=y+step;
- write(x,' ',y,#13#10);
- read(answ);
- until answ=0;
- if count=2 then begin
- write('A ',x+1,' ',y-1,#13#10);
- break;
- end;
- step:=trunc(step/2);
- if step<1 then step:=1;
- if step=1 then count:=count+1;
- repeat //вправо
- if (x+step)<=1000000000 then
- x:=x+step;
- write(x,' ',y,#13#10);
- read(answ);
- until answ=0;
- if count=2 then begin
- write('A ',x-1,' ',y-1,#13#10);
- break;
- end;
- step:=trunc(step/2);
- if step<1 then step:=1;
- if step=1 then count:=count+1;
- repeat //вниз
- if (y-step)>=0 then
- y:=y-step;
- write(x,' ',y,#13#10);
- read(answ);
- until answ=0;
- if count=2 then begin
- write('A ',x-1,' ',y+1,#13#10);
- break;
- end;
- step:=trunc(step/2);
- if step<1 then step:=1;
- if step=1 then count:=count+1;
- repeat //влево
- if (x-step)>=0 then
- x:=x-step;
- write(x,' ',y,#13#10);
- read(answ);
- until answ=0;
- if count=2 then begin
- write('A ',x+1,' ',y+1,#13#10);
- break;
- end;
- step:=trunc(step/2);
- if step<1 then step:=1;
- if step=1 then count:=count+1;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement