Cod sursa(job #1246432)
Utilizator | Data | 21 octombrie 2014 08:33:04 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<fstream>
#include<math.h>
using namespace std;
int main()
{
ifstream fin ("fact.in");
ofstream fout("fact.out");
int p,d,nr,x,e=0,l;
fin>>p;
nr=0;
while(e<p)
{
nr++;
d=nr;
x=1;
l=powl(5,x);
while(d%l==0)
{
e++;
x++;
l=powl(5,x);
}
}
fout<<nr;
}