program faktorial;
uses sysutils;


function Faktorial1(x:integer):real;
begin
  Assert( x>=0 ,'Faktorial zaporneho cisla neumim');

  if x=0 then Faktorial1:=1
         else Faktorial1:=x*Faktorial1(x-1);

end;


function Faktorial2(x:integer):real;
var i:integer;
    P:real;
begin
  Assert( (x>=0) AND (x<160) ,'Faktorial2: Parametr funkce mimo povolene meze.');
  P:=1;
  for i :=1 to x do P:=P*i;
  Faktorial2:=P;
end;

var i:integer;

begin
 for i := 0 to 50 do Writeln(i,' ',Faktorial1(i),' ',Faktorial2(i));
 readln;
end.