Search found 1 match

by pobuhov
Tue Oct 01, 2002 8:59 pm
Forum: Volume 7 (700-799)
Topic: 729 - The Hamming Distance Problem
Replies: 54
Views: 21443

729 - Why output limit?

[pascal]
Var
X,Size,Count: Word;
S: String;

Procedure Find(Pos, Count: Word);
begin
If Pos=Size+1 then
WriteLn(S) else
begin
if size-pos>=count then
begin
s[pos]:='0';
Find(Pos+1,Count);
end;

if Count>0 then
begin
S[pos]:='1';
Find(Pos+1,count-1);
end;
end;
end;


begin
Repeat ...

Go to advanced search