Cod sursa(job #267272)

Utilizator andrei92Andrei Socaciu andrei92 Data 26 februarie 2009 23:30:05
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.25 kb
#include<fstream.h>

long p;

ifstream f("fact.in");
ofstream g("fact.out");

int main()
 {  f >> p;
    if(p==0) g << 1;
    else
       if(p<5) g << 5*p;
       else
	  if(p!=5) g << 5*(p-1);
	  else g << -1;
    g.close();
    return 0;
 }