Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лаба 5 вар 9 / 2 / Unit1

.pas
Скачиваний:
8
Добавлен:
18.07.2019
Размер:
1.01 Кб
Скачать
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var x, y:real;
a, b, c, d:boolean;
begin
x:=StrToFloat(Edit1.Text);
y:=StrToFloat(Edit2.Text);
a:=(y<=-x+2) and (x>=0) and (y>=0) and (x<=2) and (y<=2);
b:=(y>=-x-2) and (x<=0) and (y<=0) and (x>=-2) and (y>=-2);
c:=(y<=x+2) and (x>=0) and (y<=0) and (x<=2) and (y>=-2);
d:=(y>=x-2) and (x<=0) and (y>=0) and (x>=-2) and (y<=2);

if a or b or c or d then Label3.Caption:='Точка принадлежит области'
else Label3.Caption:='Точка не принадлежит области';
end;

end.
Соседние файлы в папке 2
  • #
    18.07.20192.02 Кб8Project1.dof
  • #
    18.07.2019188 б7Project1.dpr
  • #
    18.07.2019876 б7Project1.res
  • #
    18.07.20194.75 Кб7Unit1.dcu
  • #
    18.07.20191.43 Кб7Unit1.dfm
  • #
    18.07.20191.01 Кб8Unit1.pas