Pages

Senin, 16 November 2009

TUgas praktikum pengurutan Angka

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var a,b,c: integer;
begin
a:=strtoint(edit1.Text);
b:=strtoint(edit2.Text);
c:=strtoint(edit3.Text);

if (a>b) and (a>c) and (b>c) then
begin
edit4.text:=inttostr(a);
edit5.text:=inttostr(b);
edit6.Text:=inttostr(c);
end
else if (b>a) and (a>c) and (b>c) then
begin
edit4.text:=inttostr(b);
edit5.text:=inttostr(a);
edit6.Text:=inttostr(c);
end

else if (b>a) and (c>a) and (b>c) then
begin
edit4.text:=inttostr(b);
edit5.text:=inttostr(c);
edit6.Text:=inttostr(a);
end

else if (a>b) and (c>a) and (c>b) then
begin
edit4.text:=inttostr(c);
edit5.text:=inttostr(a);
edit6.Text:=inttostr(b);
end

else if (a>b) and (a>c) and (c>b) then
begin
edit4.text:=inttostr(a);
edit5.text:=inttostr(c);
edit6.Text:=inttostr(b);
end

else if (b>a) and (c>a) and (c>b) then
begin
edit4.text:=inttostr(c);
edit5.text:=inttostr(b);
edit6.Text:=inttostr(a);
end

0 komentar:

Posting Komentar