Cod sursa(job #673069)

Utilizator hcalinHrih Calin hcalin Data 3 februarie 2012 20:23:12
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.23 kb
#include <fstream>
using namespace std;

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

long long p,x,y,n;

int main(){
	f>>p;
	y=p;
	y=y/6;
	y=y*5;
	n=p*5-y;
	if(p==0)
		n=1;
	if(p<0)
		n=-1;
	g<<n;
	return 0;
}