Cod sursa(job #207048)
Utilizator | Data | 11 septembrie 2008 13:54:30 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream.h>
long i,p,nr,aux;
int main()
{
ifstream fin("fact.in");
fin>>p;
fin.close();
i=1;
while(nr<p)
{if(i%5==0)
{aux=i;
while(aux%5==0)
{nr++;
aux/=5;
}
}
i++;
}
ofstream fout("fact.out");
fout<<i-1;
fout.close();
return 0;
}