Cod sursa(job #121388)
Utilizator | Tabacu Raul Consstantin | Data | 8 ianuarie 2008 16:54:26 |
---|---|---|---|
Problema | Factorial | Scor | 45 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream.h>
unsigned long int x,p;
unsigned long int i,j,k,l;
int main ()
{ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
while (i+j<p)
{i++;
l=i;
if(l%5==0)
while(l%5==0)
{
l=l/5;
j++;
}
}
if (i+j==p)
g<<i*5;
else
g<<0;
f.close();
g.close();
return 0;
}