Cod sursa(job #584125)
Utilizator | Data | 24 aprilie 2011 10:38:01 | |
---|---|---|---|
Problema | Factorial | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{int i,fm=0,m,p,n;
f>>p;
if(p==0) g<<1; else{
n=p*5;
i=5;
do
{m=i;
while(m%5==0)
{fm++;
m/=5;}
if(fm==p) g<<i;
i+=5;}while(i<=n);
}
return 0;
}