|
|
back to boardwhy is it not true???? program z; var n,k:byte; f:longint; s:string[30]; procedure factorial1(n,k:byte); var q:integer; begin q:=n; while q>=k do begin f:=f*q; q:=q-k; end; end; procedure factorial2(n,k:byte); var q:integer; begin q:=n; while q>=(n mod k) do begin f:=f*q; q:=q-k; end; end; begin read (n,s); k:=length(s); f:=1; IF n mod k=0 then factorial1(n,k) else factorial2(n,k); writeln (f); end. |
|
|