Cod sursa(job #526285)
Utilizator | Data | 27 ianuarie 2011 22:26:44 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include <fstream.h>
#include <cmath.h>
int main()
{
long long i,nr=0,x=0,s,p;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
i=0;
s=1;
x=pow(10,p);
while (nr<p)
{
i++;
s=s*i;
if (s % x==0)
nr=p;
}
g<<i;
return 0;
}