|
|
back to boardWho can tell me why I am Wrong?? Thanks a lot. My source is Here Posted by Lion 20 Aug 2003 12:39 {$N+} var s : string; i , j , k , n : longint; Sum : extended; begin readln(s); for i := 1 to length(s) do if not(s[i] in ['0' .. '9']) then begin j := i; break; end else n := n * 10 + ord(s[i]) - 48; k := length(s) - j + 1; sum := 1; if n mod k = 0 then begin j := 0; repeat sum := sum * (n - j); j := j + k; Until (n - j) <= k; if k < n then sum := sum * k; end else begin j := 0; repeat sum := sum * (n - j); j := j + k; until (n - j) <= (n mod k); if (n mod k < n) then sum := sum * (n mod k); end; writeln(sum : 0 : 0); end. |
|
|