ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1083. Factorials!!!

why is not true?
Posted by Domolaz 25 Feb 2011 00:56
var
   n,f,k:longint;
   s:string;
begin
   readln(n,s);
   f:=1;
   k:=length(s);
   if n=0 then
   begin
      writeln('1');
      halt;
   end;
   if k>=n then
   begin
      writeln(n);
      halt;
   end;
   while (n>=k) do
   begin
      f:=f*n;
      n:=n-k;
   end;
   writeln(f);
end.
Re: why is not true?
Posted by amirani 18 Jul 2011 22:19
because if k>=n or n=0 you will write 2 answers :)