Cod sursa(job #1854151)
Utilizator | Data | 22 ianuarie 2017 14:11:32 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
Program vv;
Var f,g:Text;
i,p,n:Longword;
Begin
Assign (f,'fact.in');Reset (f);
Assign (g,'fact,out');Rewrite (g);
Readln (f,p);
n:=1;
If p=0 then n:=1
Else
If p=1 then n:=1
Else
Begin
For i:=1 to p do
n:=n*i;
End;
Writeln (g,n);
Close (f);Close (g);
End.