Cod sursa(job #1432671)
Utilizator | Data | 9 mai 2015 13:57:00 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int P,i,N,p,c,a;
int main()
{fin>>P;
p=1;
if(P=0)
fout<<1;
else
{for(i=1;i<5*P;i++)
{
p=p*i;
}
}
while(p!=0)
{ c=p%10;
p=p|10;
if(c=0)
{
a++;
}
}
if(a=P)
{fout<<5*P;
}
fin.close();fout.close();
return 0;
}