呵呵!你是不是在做模拟彩票啊!
var
Form1: TForm1;
num:array[0..7] of integer;
qq:array[1..7] of integer;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
label 10;
var
i,j,k,t:integer;
begin
randomize;
for i:=1 to 7do
begin
10: num:=random(33)+1;
qq:=num;
for j:=1 to ido
if qq=num[i-j] then
goto 10;
end;
for j:=1 to 6do
for k:=1 to 7-jdo
if num[k+1]<num[k] then
begin
t:=num[k];num[k]:=num[k+1];num[k+1]:=t;
end;
label1.caption:=inttostr(num[1]);
label2.caption:=inttostr(num[2]);
label3.caption:=inttostr(num[3]);
label4.caption:=inttostr(num[4]);
label5.caption:=inttostr(num[5]);
label6.caption:=inttostr(num[6]);
label7.caption:=inttostr(num[7]);
end;