Var s : String; n : Integer; Function IncS(a : String) : String; Begin a[Length(a)]:=Chr(Ord(a[Length(a)])+1); If a[Length(a)]>'D' then IncS:=IncS(Copy(a,1,Length(a)-1))+'A' else IncS:=a; end; Function Check(a : String) : Boolean; Begin Check:=False; If (Pos('A',a)>0) then Begin Delete(a,Pos('A',a),1); If (Pos('A',a)>0) then Check:=True; end; end; Begin s:=''; n:=0; While s<>'' do Begin { Writeln(s); } If Check(s) then Inc(n); s:=IncS(s); end; Writeln(n); end.
Var s : String; n : Integer; Function IncS(a : String) : String; Begin a[Length(a)]:=Chr(Ord(a[Length(a)])+1); If a[Length(a)]>'D' then IncS:=IncS(Copy(a,1,Length(a)-1))+'A' else IncS:=a; end; Function Check(a : String) : Boolean; Begin Check:=False; If (Pos('A',a)>0) then Begin Delete(a,Pos('A',a),1); If (Pos('A',a)>0) then Check:=True; end; end; Begin s:=''; n:=0; While s<>'' do Begin { Writeln(s); } If Check(s) then Inc(n); s:=IncS(s); end; Writeln(n); end.
может ты имел ввиду
a = ("py")
b = ("thon")
c = a + b
print(c)
input()
Объяснение: