Cod sursa(job #382577)
| Utilizator | Data | 13 ianuarie 2010 22:36:43 | |
|---|---|---|---|
| Problema | Factorial | Scor | 25 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.26 kb |
#include<fstream.h>
ifstream fin("fact.in");
ofstream fout("fact.out");
long P,ci,N,ok,cN;
int main()
{
fin>>P;
do
{
N++;
cN=N;
while(cN!=1)
if(cN%5==0)
{
ok++;
cN=cN/5;
}
else
cN=1;
}
while(ok!=P);
fout<<N;
}
