Cod sursa(job #1021927)
Utilizator | Data | 4 noiembrie 2013 14:48:14 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int p,i,n;
fin>>p;
for(n=1;p>0;n++)
{
i=n;
while(i%5==0)
{
p--;
i/=5;
}
}
if(n>1)
--n;
fout<<n;
}