Предмет: Информатика, автор: Sonya9643

Как в Lazarus решить ax=b

Ответы

Автор ответа: SalohiyatDP
1
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;

SalohiyatDP: type

{ TForm1 }

TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit3: TEdit;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
SalohiyatDP: var
Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
var a,b,x: string;
begin
a:= Edit1.Text;
b:= Edit3.Text;
begin
SalohiyatDP: if a:=0 then
Label1.Caption:='nemae';
else
if a:=0 and b:=0 then
Label1.Caption:='bezlich';
SalohiyatDP: else
if Not(a=0) and b:=0 then
Label1.Caption:=FloatToStr(x=0):
SalohiyatDP: if Not(a=0) and Not (b=0) then
SalohiyatDP: x:=b/a;
Label1.Caption:=FloatToStr(x);
end;
Похожие вопросы
Предмет: География, автор: Учимся18