Cod sursa(job #1629992)
Utilizator | Data | 4 martie 2016 20:47:44 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
long p,n,t,i;
int ok,o;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
ok=0;
n=1;
while (ok==0)
{
t=1;
for(i=1;i<=n;i++)
t=t*i;
o=0;
while (p%10==0)
o++;
if(t=o)
ok=1;
else
n++;
}
g<<n;
return 0;
}