Cod sursa(job #252700)

Utilizator mathboyDragos-Alin Rotaru mathboy Data 4 februarie 2009 20:43:20
Problema Factorial Scor 15
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include <fstream.h>
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
    long long int i,e=2,c,p;
    f>>p;
if(p==1)	return 0;
for(i=5;e<=p;i=i+5)
  { c=i;
  while(c%5==0)
	{
       c=c/5;e++; }}
  g<<i;
  f.close();
  g.close();
  return 0;}