Cod sursa(job #670381)
Utilizator | Data | 28 ianuarie 2012 23:03:28 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream>
using namespace std;
fstream fin("fact.in",ios::in),fout("fact.out",ios::out);
int main()
{
int p,ok,t,j,a=1,v5=0;
fin>>p;
ok=1;
while(v5<p)
{
j=a;
t=0;
while(j%5==0)
{
t++;
j/=5;
}
v5+=t;
a++;
}
fout<<a-1;
fin.close();
fout.close();
return 0;
}