1.
var
sList: TStringList;
i,j,k,l: Integer;
begin
ListBox1.Clear;
FExit := False;
sList := TStringList.Create;
sList.CommaText := 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
for i := 0 to 25do
begin
if FExit then
Break;
for j := 0 to 25do
begin
if j = i then
Continue;
for k := 0 to 25do
begin
if (k = i) or (k = j) then
Continue;
for l := 0 to 25do
begin
if (l = i) or (l = k) or (l = j) then
Continue;
label1.Caption := sList.Strings + sList.Strings[j] +
sList.Strings[k] + sList.Strings[l];
ListBox1.Items.Add(label1.Caption);
label2.Caption := IntToStr(ListBox1.Count);
Application.ProcessMessages;
end;
end;
end;
end;
sList.Free;
end;
2.
var
sList: TStringList;
i,j,k,l: Integer;
begin
ListBox1.Clear;
FExit := False;
sList := TStringList.Create;
sList.CommaText := 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
for i := 0 to 25do
begin
if FExit then
Break;
for j := 0 to 25do
begin
for k := 0 to 25do
begin
if k = j then
Continue;
for l := 0 to 25do
begin
if (l = k) or (l = j) then
Continue;
label1.Caption := sList.Strings + sList.Strings[j] +
sList.Strings[k] + sList.Strings[l];
ListBox1.Items.Add(label1.Caption);
label2.Caption := IntToStr(ListBox1.Count);
Application.ProcessMessages;
end;
end;
end;
end;
sList.Free;
end;