procedure TForm1.btn1Click(Sender: TObject);
var
i:integer;
temp,str:string;
x,y,z:integer;
num: array[1..1000] of integer;
begin
str:=trim(edt1.Text);
i:=1;
while (i < length(str))do
begin
while((str[i]<> #32) and (str[i]<>#0))do
begin
temp:=temp+str[i];
i:=i+1;
end;
n:=n+1;
num[n]:=strtoint(temp);
temp:='';
i:=i+1;
end;
for x:=1 to n do
begin
z:=n-x;
for y:=1 to z do
begin
if(num[y]<num[y+1])then
begin
i:=num[y];
num[y]:=num[y+1];
num[y+1]:=i;
end;
end;
end;
edt1.text:='';
for i:=n downto 1 do
begin
edt1.text:=edt1.text+inttostr(num[i])+' ';
end;