1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Const N=3;
Var
S : String[N];
i : Integer;

Function Plus1(ss : String) : String;
Begin
If Length(ss)>0 then
If ss[Length(ss)]='0' then Plus1:=Copy(ss,1,Length(ss)-1)+'1'
else Plus1:=Plus1(Copy(ss,1,Length(ss)-1))+'0';
end;

Begin
S:='';
For i:=1 to N do S:=S+'0';
Repeat
If Pos('11',S)=0 then Writeln(S);
S:=Plus1(S);
Until Pos('0',S)=0;
end.
Переделать программу на с++

Respuesta :

ACCESS MORE