function ZsDispose(mCount: Integer): string;
function f(mLength: Integer): string;
var
I, L: Integer;
S1, S2: string;
begin
if mLength = 1 then
Result := '01'
else if mLength > 1 then begin
Result := f(Pred(mLength));
L := Length(Result);
S1 := '';
for I := 1 to L do begin
if Pred(I) mod Pred(mLength) = 0 then
AppendStr(S1, '0');
AppendStr(S1, Result[I]);
end; S2 := '';
for I := 1 to L do begin
if Pred(I) mod Pred(mLength) = 0 then
AppendStr(S2, '1');
AppendStr(S2, Result[I]);
end;
Result := S1 + S2;
end else Result := '';
end;
var
I: Integer;
S: string;
begin
S := f(mCount);
for I := 1 to Length(S) do begin
if Pred(I) mod mCount = 0 then
AppendStr(Result, ',');
AppendStr(Result, S[I]);
end;
Delete(Result, 1, 1);
end;
function f(mLength: Integer): string;
var
I, L: Integer;
S1, S2: string;
begin
if mLength = 1 then
Result := '01'
else if mLength > 1 then begin
Result := f(Pred(mLength));
L := Length(Result);
S1 := '';
for I := 1 to L do begin
if Pred(I) mod Pred(mLength) = 0 then
AppendStr(S1, '0');
AppendStr(S1, Result[I]);
end; S2 := '';
for I := 1 to L do begin
if Pred(I) mod Pred(mLength) = 0 then
AppendStr(S2, '1');
AppendStr(S2, Result[I]);
end;
Result := S1 + S2;
end else Result := '';
end;
var
I: Integer;
S: string;
begin
S := f(mCount);
for I := 1 to Length(S) do begin
if Pred(I) mod mCount = 0 then
AppendStr(Result, ',');
AppendStr(Result, S[I]);
end;
Delete(Result, 1, 1);
end;
解决方案 »
- 知道的很简单:如何禁止UAC虚拟化(UAC Virtualization)
- 用程序实现自动备份
- Delphi 高手帮忙
- 我用的是DELPHI7.0中BDE,请问在DBGrid中利用TQuery和DataSource删除一条记录后,怎样才能让刷新后的数据再次显示在DBGrid中?
- 请问CreateOleObject在哪个单元,我使用时怎么说没定义???
- Delphi中如何给Form1添加背景??
- 图片从sql server中取出的问题
- 500分求一简单画图源代码
- 控件安装问题:[Fatal Error] TB97_d6.dpk(31): Required package 'vcl' not found
- 如何向MSSQL表中添加BLOB类型的数据?
- 关于RTF编辑组件内容定位
- 如何用delphi实现发票的精确打印
var
y,i,t,k,count:integer;
s : string;
begin
for t:=1 to n do
begin
setlength(s,t+1);
y:=(1 shl t);
for i:= 1 to y do
begin
count := t;
k:=i-1;
while count>0 do
begin
s[count]:=char((k mod 2)+48);
count:=count-1;
k:=(k div 2);
end;
listbox1.items.add(s);
end;
end;
end;