Cod sursa(job #422795)

Utilizator paul_gabryelPaul Buda paul_gabryel Data 23 martie 2010 10:46:41
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include<iostream>
#include<fstream>
using namespace std;
int p;
int main ()
{
	ifstream fin ("fact.in");
	ofstream fout ("fact.out");
	fin>>p;
	int aux=0;
	if(p==0)
	fout<<1<<endl;
	else{
		for(int i=1;i<=p;++i){
			aux+=5;
			if(i%5==0)
			--p;
		}
	fout<<aux<<endl;
	}
	
	return 0;
}