当前位置:主页>仓库管理软件> 列表

怎样从 AAAA 跳到 ZZZZ 找最好的财务软件

仓库管理软件版1楼: 输入条件:1、起始号码 2、数量(其中起始号码为4位字母)

输出为 4位的字母

比如起始号码为AAAA 数量为2,输出为AAAA和AAAB
比如起始号码为AAAA 数量为27,输出为AAAA,AAAB,...,AAAZ,AABA

就是字母流水增加

2楼: 四层循环嘛 如最好的财务软件

3楼: richiesj1118你好,麻烦说细些

4楼: 還沒明白樓主的意思,能具體一點可以幫你寫代碼試一試。
QQ:136293586

5楼: var
A: Array[0..3] of char;
begin
a[0] := ''A'';
a[1] := ''A'';
a[2] := ''A'';
A[3] := ''A'';
end;

procedure Add(value: integer);
begin
A[3] := Chr((byte(a[3]) + Value) Mod 65);
A[2] := Chr((byte(a[3] + Value) div 65) + A[2]);
如此类推, 我没有测试代码。 给你个提示
end;

6楼: function CodeJournal(Code: string; Num: Integer): string;
var
I: Integer;
C: Char;
begin
Assert(Length(Code) > 0, ''Code is null'');
Code := UpperCase(Code);
Result := Code;
Dec(Num);
while Num > 0 do
begin
for I := Length(Code) downto 1 do
begin
C := Code[I];
Inc(C);
Code[I] := C;
if C <= ''Z'' then Break;
Code[I] := ''A'';
end;
Result := Result + '','' + Code;
Dec(Num);
end;
end;

仓库管理软件版7楼: function CreateStrList(szSource : String; nCount : integer; slOut : TStrings) : boolean;
function GetNextStr(var szStr : String) : boolean;
begin
result := false;
if UpperCase(szStr) = ''ZZZZ'' then exit;
if Copy(szStr,4,1) <> ''Z'' then szStr := Copy(szStr,1,3) + Chr(Ord(Copy(szStr,4,1)[1]) + 1)
else if Copy(szStr,3,1) <> ''Z'' then szStr := Copy(szStr,1,2) + Chr(Ord(Copy(szStr,3,1)[1]) + 1) + ''A''
else if Copy(szStr,2,1) <> ''Z'' then szStr := Copy(szStr,1,1) + Chr(Ord(Copy(szStr,2,1)[1]) + 1) + ''AA''
else if Copy(szStr,1,1) <> ''Z'' then szStr := Chr(Ord(Copy(szStr,1,1)[1]) + 1) + ''AAA'';


result := true;
end;
var
i : integer;
szCurStr : String;
begin
result := false;
if Length(szSource) <> 4 then exit;
slOut.Clear;
szCurStr := szSource;
for i := 1 to nCount do
begin
slOut.Add(szCurStr);
if not getNextStr(szCurStr) then
begin
exit;
end;
end;
result := true;
end;

8楼: 谢谢大家,lichengbin的方法可以,ak_2004的我还没测试