Cod sursa(job #306982)

Utilizator GulosSerban Petrescu Gulos Data 22 aprilie 2009 17:05:05
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include<iostream>
#include<fstream>

using namespace std;

int main(){
int n,p,m;
	ifstream fin("fact.in");
	fin>>p;
	n=5;
	m=61305156;
	while (m>5){
		p-=(p/m);
		m=(m-1)/5;
	}
	ofstream fout("fact.out");
	fout<<p*5;
	fout.close();
	return 0;
}