Cod sursa(job #557481)

Utilizator SebiSebiPirtoaca George Sebastian SebiSebi Data 16 martie 2011 18:00:40
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.24 kb
#include<fstream.h>
int main ()
{
	long n,i,x;
	ifstream f("fact.in");
	ofstream g("fact.out");
	f>>n;
	f.close();
	x=n*5;
	if(x==0) g<<"1";
	else if(n==5) g<<"-1";
	else if(x>25) g<<x-5;
	else g<<x;
	g.close();
	return 0;
}