Cod sursa(job #528164)
Utilizator | Data | 2 februarie 2011 11:54:14 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream.h>
int i=0,j,k=5,p,s=0,l=0,o,u=0,aux;
int main(){
ifstream fin("fact.in");
fin>>p;
fin.close();
ofstream fout("fact.out");
/*while(l<p)
{ l=0;
k=5;
i++;
while(i/k)
{
l=l+i/k;
k=k*5;
}
}
fout<<i<<" ";
*/
j=0;
while(u!=p)
{ j++;
aux=j;
while(aux%5==0)
{
u++;
aux=aux/5;
}
}
fout<<j;
fout.close();
return 0;
}