function ZsLadder(mText: string; mLength: Integer = 0): string; { 阶梯 }
var
  I, L: Integer;
  S, T: string;
begin
  Result := '';
  L := Length(mText);
  if L < 1 then Exit;
  if mLength <= 0 then mLength := L;
  S := '';
  for I := 1 to mLength do S := S + mText[1]; //00000
  T := '';
  for I := 1 to mLength do T := T + mText[L]; //44444  while S <> T do begin
    Result := Result + S + #13#10;
    for I := mLength downto 1 do
      if S[I] = mText[L] then
        S[I] := mText[1]
      else begin
        S[I] := mText[Pos(S[I], mText) + 1];
        Break;
      end;
  end;  Result := Result + S + #13#10;
end; { ZsLadder }procedure TForm1.Button1Click(Sender: TObject);
var
  I: Integer;
begin
  with TStringList.Create do try
    Text := ZsLadder('abcdefghijklmnopqrstuvwxyz', 2);
    Text := Text + ZsLadder('abcdefghijklmnopqrstuvwxyz', 3);    for I := Count - 1 downto IndexOf('xbn') + 1 do Delete(I);
    for I := IndexOf('kq') - 1 downto 0 do Delete(I);
    RichEdit1.Text := Text;
  finally
    Free;
  end;
end;

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      with TStringList.Create do try
        Text := Text + ZsLadder('abcdefghijklmnopqrstuvwxyz', 1);
        Text := Text + ZsLadder('abcdefghijklmnopqrstuvwxyz', 2);
        Text := Text + ZsLadder('abcdefghijklmnopqrstuvwxyz', 3);
        SaveToFile('C:\Temp.txt');
      finally
        Free;
      end;
    end;procedure TForm1.Button2Click(Sender: TObject);
    var
      I, B, E: Integer;
    begin
      with TStringList.Create do try
        LoadFromFile('C:\Temp.txt');
        B := IndexOf(Edit1.Text);
        E := IndexOf(Edit2.Text);
        for I := Count - 1 downto 0 do if (I > E) or (I < B) then Delete(I);
        RichEdit1.Text := Text;
      finally
        Free;
      end;
    end;
      

  2.   

      Edit1.Text := IntToStr(26 * 26* 26* 26* 26* 26);//308915776308915776//!!!!!!
      

  3.   

    如果我要从EDIT1 到 EDIT2 数量不确定,那我怎么写呢?zswang(伴水)(需要充充电)你真的好厉害哦。
      

  4.   

    //也不知道你想实现什么
    但是你要考虑可行性问题'a' -> 'zzzzzz' //26^6//308915776308915776你要显示在什么地方