Answer the question
In order to leave comments, you need to log in
How to write pascal result to text file?
Program P42;
Procedure Print(Sc : string; S : String);
Var i,l,k : integer;
Begin
l:=length(Sc);
for i:=1 to l do Begin
k:=Ord(Sc[i]);
write(S[k]);
End;
writeln;
End;
Procedure Gen(n : integer; S : string);
Var Sc : String;
Var i,j,p : integer;
Var k,m,f : integer;
Begin
k:=length(S);
f:=0;
Sc:=chr(1);
for i:=2 to n do Sc:=Sc+Chr(1);
while (True) do Begin
Print(Sc,S);
p:=1;
while (True) do Begin
m:=Ord(Sc[p]);
if m<k then Begin
Sc[p]:=chr(m+1);
break;
end
else Begin
if p=n then begin
f:=1;
break;
end;
Sc[p]:=chr(1);
p:=p+1;
end;
End;
if f > 0 then break;
End;
End;
Begin
Gen(32,'abcdef0123456789');
End.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question