Cod sursa(job #560943)
Utilizator | Data | 18 martie 2011 19:20:21 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream>
using namespace std;
int main()
{
int p,n=1,c5=0,cpy;
ifstream In("fact.in");
In>>p;
In.close();
if(p>0)
while(c5<p)
{
n++;
if(n%5==0)
{
cpy=n;
while(cpy%5==0)
{
c5++;
cpy/=5;
}
}
}
ofstream Out("fact.out");
Out<<n;
Out.close();
return 0;
}