language: Pascal (gpc) (gpc 20070904)
date: 107 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
program maxfact (input,output);
    var N , i, j : integer;
function fact (m : integer) : integer;
begin
   if (m=0) or (m=1) then fact:=1
     else fact:=fact(m-1)*m;
end;
   
begin
    read(N);
    i:=0;
    if N=0 then writeln('1')
       else
        begin 
          while fact(i)<=N do i:=i+1;
          j:=i-1;
          writeln(j)
        end;
end.