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