Cod sursa(job #63256)
Utilizator | Data | 27 mai 2007 17:39:55 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream.h>
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
unsigned long n=0,p,fife=0,fif;
g<<0<<' '<<1<<endl;
for(p=1;p<=100000000;p++)
{while(n<p)
{fife+=5;fif=fife;
while(!(fif%5))
{n++;fif/=5;g<<}
g<<n<<' '<<fife<<endl;
}
}
return 0;
}