Cod sursa(job #826599)
Utilizator | Data | 30 noiembrie 2012 21:48:21 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<fstream>
#include<math.h>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int p,x,c,k=0;
long f=1,i=1;
fin>>p;
if(p==0)fout<<"1";
while(k!=p)
{
for(i=1;i<=900000000;i++)
{
f=f*i;
x=f;
k=0;
while(x)
{
c=x%10;
x=x/10;
if(c==0)k++;
}
}
}
fout<<i;
fin.close();
fout.close();
return 0;
}