Q
QXCOMM
Unregistered / Unconfirmed
GUEST, unregistred user!
0.1.2.3.4.5.6.7.8.9共10个数,如何取出其中6个数字的组合,应该是210种,如何把结果算出来?
var
i ,j,k,l,m,n,count: Integer;
t : String;
begin
count:=0;
for i := 1 to 10 do
begin
for j := i+1 to 10 do
begin
for k := j+1 to 10 do
begin
for l := k+1 to 10 do
begin
for m:= l+1 to 10 do
begin
for n :=m+1 to 10 do
begin
t := inttostr(i) +','+inttostr(j) + ','+inttostr(k) +','+inttostr(l) + ','+inttostr(m) + ','+inttostr(n);
memo1.Lines.Add(t);
count:=count+1;
end;
end;
end;
end;
end;
end;
ShowMessage(IntToStr(count));
end;