Аггей
5 год назад
Нужно написать программу на pascal abc
ОТВЕТЫ
Frontasiy
Aug 11, 2019
//PascalABC.NET 3.2 сборка 1318
Var x1,y1,x2,y2,x,y,x3,y3,x4,y4:integer;
begin
read(x1,y1,x2,y2,x,y);
x3:=x1;
y3:=y2;
x4:=x2;
y4:=y1;
if (xlt;x1) and (ylt;=y3) and (ygt;=y1) then writeln(W) else
if (xlt;x1) and (ygt;y3) then writeln(NW) else
if (xgt;=x1) and (xlt;=x2) and (ygt;y3) then writeln(N) else
if (xgt;x2) and (ygt;y3) then writeln(NE) else
if (xgt;x2) and (ylt;=y2) and (ygt;=y4) then writeln(E) else
if (xgt;x2) and (ylt;y4) then writeln(SE) else
if (xlt;=x4) and (xgt;=x1) and (ylt;y4) then writeln(S) else
if (xlt;x1) and (ylt;y1) then writeln(SW);
end.
Пример ввода:
-2 1 4 4 -3 5
Пример вывода:
NW
Var x1,y1,x2,y2,x,y,x3,y3,x4,y4:integer;
begin
read(x1,y1,x2,y2,x,y);
x3:=x1;
y3:=y2;
x4:=x2;
y4:=y1;
if (xlt;x1) and (ylt;=y3) and (ygt;=y1) then writeln(W) else
if (xlt;x1) and (ygt;y3) then writeln(NW) else
if (xgt;=x1) and (xlt;=x2) and (ygt;y3) then writeln(N) else
if (xgt;x2) and (ygt;y3) then writeln(NE) else
if (xgt;x2) and (ylt;=y2) and (ygt;=y4) then writeln(E) else
if (xgt;x2) and (ylt;y4) then writeln(SE) else
if (xlt;=x4) and (xgt;=x1) and (ylt;y4) then writeln(S) else
if (xlt;x1) and (ylt;y1) then writeln(SW);
end.
Пример ввода:
-2 1 4 4 -3 5
Пример вывода:
NW
277
Смежные вопросы: