Cod sursa(job #111448)
| Utilizator | Data | 29 noiembrie 2007 20:53:19 | |
|---|---|---|---|
| Problema | Factorial | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.26 kb |
#pragma option -3 -r -Z -O2 -a
#include<fstream.h>
int main()
{
ifstream f("fact.in");
ofstream h("fact.out");
register unsigned long i=5,j=0,x,p;
f>>p;
while(j<p)
{x=i;
if(x%25==0) while(x%5==0) j++,x/=5;
i+=5;
j++;
}
h<<i;
return 0;
}