Cod sursa(job #1320421)

Utilizator Goia_iulianGoia Iulian Goia_iulian Data 17 ianuarie 2015 22:59:46
Problema Factorial Scor 20
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.41 kb
program suma;
var n,p:integer;
    f,g:text;
begin
  assign(f,'fact.in');
  reset(f);
  assign(g,'fact.out');
  rewrite(g);
    readln(f,p);
    if p=0 then
      n:=1
      else
    if p=1 then
      n:=5
    else
    if p=2 then
      n:=10
    else
    if p=3 then
      n:=16
    else
    if p=4 then
      n:=20
    else
      n:=-1;
    writeln(g,n);
  close(f);
  close(g);
end.