viernes, 1 de mayo de 2009

Multiplicacion de menores y divicion de mayores


unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure BitBtn1Click(Sender: TObject);
private { Private declarations }
public { Public declarations }
end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1ClickSender:TObject);
var
a:integer;
b:integer;
c:integer;
d:integer;
m,n:real;
begin
a:=StrToInt(Edit1.Text);
b:=StrToInt(Edit2.Text);
c:=StrToInt(Edit3.Text);
d:=StrToInt(Edit4.Text);

if((a>b) and (a>c) and (a>d))then
begin
if((b>c)and (b>d))then
begin
m:=a/b;
n:=c*d;
end;
else
begin
If((c>b)and (c>d))then
begin
m:=a/c;
n:=b*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((d>c)and(d>b))then
begin
m:=a/d;
n:=b*c;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;

end
else
begin
if((b>a) and (b>c) and (b>d))then
begin//inicio
if((a>c)and (a>d))then
begin
m:=b/a;
n:=c*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
If((c>a)and (c>d))then
begin
m:=b/c;
n:=a*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((d>a)and(d>c))then
begin
m:=b/d;
n:=a*c; edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;


end//fin
else
begin
if((c>a) and (c>b) and (c>d))then
begin//inicio
if((a>b)and (a>d))then
begin
m:=c/a;
n:=b*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
If((b>a)and (b>d))then
begin
m:=c/b;
n:=a*d;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((d>a)and(d>b))then
begin
m:=c/d;
n:=a*b;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;
end//final
else
begin
if((d>a) and (d>b) and (d>c))then
begin//inicio
if((a>b)and (a>c))then
begin
m:=d/a;
n:=c*b;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
If((b>a)and (b>d))then
begin
m:=d/b;
n:=a*c;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end
else
begin
if((c>a)and(c>b))then
begin
m:=d/c;
n:=a*b;
edit5.Text:=FloatToSTR(n);
edit6.Text:=FloatToSTR(m);
end;
end;
end;

end;//final

end;
end;

end;


end;
end.

No hay comentarios:

Publicar un comentario