|
|
вернуться в форумHelp, what is wrong in my programm?? program factorials_1083_COD; {$APPTYPE CONSOLE} var n:integer; ks:string; k,j:integer; pr:longword; mark:boolean; begin readln(n,ks); k:=length(ks)-1; pr:=1; j:=1; pr:=n; if n mod k=0 then begin while mark=false do if (n-j*k)>0 then begin pr:=pr*(n-j*k); j:=j+1; end else mark:=true; pr:=pr*k end; if n mod k<>0 then begin while mark=false do if (n-j*k)>0 then begin pr:=pr*(n-j*k); j:=j+1; end else mark:=true; pr:=pr*(n mod k); end; writeln(pr); end. ive got wa on 5 test Edited by author 05.11.2005 15:07 Edited by author 05.11.2005 15:07 |
|
|