Cod sursa(job #667834)

Utilizator hcalinHrih Calin hcalin Data 23 ianuarie 2012 20:00:53
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include <fstream>
using namespace std;

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

unsigned long p,x,y,n;

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