• Составить программу, проверяющую принадлежность точки с координатами (x,y) заштрихованной области.

    question img

Ответы 1

  • a) Для ПРЯМОУГОЛЬНИКА:program Logika1;uses Crt;const a=1;          b=10;         c=1;         d=5; var x, y: real;      begin  ClrScr;  Write (' x = '); ReadLn(x);  Write (' y = '); ReadLn(y);  if (x>=a) and (x<=b) and (y>=c) and (y<=d) then   Writeln ('Принадлежит!') else WriteLn  ('Не принадлежит...');  ReadLn;end.Для КВАДРАТОВ:program Logika2;uses Crt; var x, y: real;          xx, yy: boolean;begin  ClrScr;  Write (' x = '); ReadLn(x);  Write (' y = '); ReadLn(y);  xx:=(x>=-1) and (x<=-0.5) or (x>=0.5) and (x<=1);  yy:=(y>=-1) and (y<=-0.5) or (y>=0.5) and (y<=1);  if (xx and yy) then Writeln ('Yes!') else WriteLn  ('No!');  ReadLn;end.Для КОЛЬЦА:program Logika3;uses Crt; const R1=4;       R2=2; var x, y: real;begin  ClrScr;  Write (' x = '); ReadLn(x);  Write (' y = '); ReadLn(y);  if (sqr(x)+sqr(y)<=sqr(R1)) and  (sqr(x)+sqr(y)>=sqr(R2))  then Writeln ('Yes!') else WriteLn  ('No!');  ReadLn;end.Для ПОЛУКРУГА и ТРЕУГОЛЬНИКА:program Logika4;uses Crt; const R=2; var x, y: real;begin  ClrScr;  Write (' x = '); ReadLn(x);  Write (' y = '); ReadLn(y);  if (sqr(x)+sqr(y)<=sqr(R)) and  (y>=x-2) and (y<=-x+2)  then Writeln ('Yes!') else WriteLn  ('No!');  ReadLn;end.
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years