Cod sursa(job #744082)
Utilizator | Data | 7 mai 2012 13:00:58 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <fstream>
using namespace std;
int main()
{
long long n,c=0,d=0,aux;
ifstream f("fact.in");
ofstream g("fact.out");
f>>n;
if(n==0)
g<<1;
else
{
while(c<n)
{
d=d+5;
aux=d;
while(aux%5==0)
{
c++;
aux=aux/5;
}
}
g<<d;
}
return 0;
}