Cod sursa(job #1136169)
Utilizator | Robert Szarvas robertkarol | Data | 8 martie 2014 21:19:09 |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.57 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
unsigned long long p,n,c,prod,i,aux;
unsigned long long iesi ()
{
return 0;
}
void tip ()
{
fout<<n;
iesi();
}
int main()
{
fin>>p;
n=1;
prod=1;
while(c!=p)
{
c=0;
if(n==2||n==5||n==10)
prod=prod*n;
aux=prod;
while(aux%10==0)
{
aux/=10;
c++;
}
if(c==p)
tip();
n++;
}
return 0;
}