Segue em delphi programa que lê 3 números inteiros digitados pelo usuário e coloca-os em ordem crescente, moleza, rsrs !!!
procedure Tfrmvalor.btncalculaClick(Sender: TObject);
var a,b,c: integer;
begin
a:= StrToInt(edtvalora.Text);
b:= StrToInt(edtvalorb.Text);
c:= StrToInt(edtvalorc.Text);
if (a <= B) and (a <= c) and (b <= c)then
begin
edtcres1.Text:= IntToStr(a);
edtcres2.Text:= IntToStr(B);
edtcres3.Text:= IntToStr(c);
end
else
if (a <= B) and (a <= c) and (c <= b)then
begin
edtcres1.Text:= IntToStr(a);
edtcres2.Text:= IntToStr(c);
edtcres3.Text:= IntToStr(B);
end
else
if (b <= a) and (b <= c) and (a <= c)then
begin
edtcres1.Text:= IntToStr(B);
edtcres2.Text:= IntToStr(a);
edtcres3.Text:= IntToStr(c);
end
else
if (b <= a) and (b <= c) and (c <= a)then
begin
edtcres1.Text:= IntToStr(B);
edtcres2.Text:= IntToStr(c);
edtcres3.Text:= IntToStr(a);
end
else
if (c <= a) and (c <= B) and (b <= a)then
begin
edtcres1.Text:= IntToStr(c);
edtcres2.Text:= IntToStr(B);
edtcres3.Text:= IntToStr(a);
end
else
if (c <= a) and (c <= B) and (a <= b)then
begin
edtcres1.Text:= IntToStr(c);
edtcres2.Text:= IntToStr(a);
edtcres3.Text:= IntToStr(B);
end;