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

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

.pas
Скачиваний:
9
Добавлен:
18.07.2019
Размер:
1 Кб
Скачать
☆
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 Кб9Project1.dof
  • #
    18.07.2019188 б8Project1.dpr
  • #
    18.07.2019876 б8Project1.res
  • #
    18.07.20195 Кб8Unit1.dcu
  • #
    18.07.20191 Кб8Unit1.dfm
  • #
    18.07.20191 Кб9Unit1.pas