|
|
вернуться в форумHelp please my code crashed on 1 test {*****************} type integer=longint; var n,k:integer; obr:string; str:string; otv:int64; procedure p(s:string); var i,l:integer; begin l:=length(s)-1; if l=n then begin inc(otv); writeln(s); exit; end; if l>n then begin exit; end; for i:=1 to k do begin if (s[l]='0')and(obr[i]='0') then continue; if (l=0)and(obr[i]='0') then continue; p(s+obr[i]); end; end; begin assignfile(input,'in.txt'); reset(input); assignfile(output,'out.txt'); rewrite(output); readln(n); readln(k); otv:=0; obr:='0123456789'; str:='_'; p(str); writeln(otv); end. {*******************} Please help! |
|
|