Cod sursa(job #371540)
Utilizator | Data | 5 decembrie 2009 18:29:59 | |
---|---|---|---|
Problema | Factorial | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <fstream.h>
int main()
{ int a,b,s,b1;
ifstream f;
f.open("fact.in");
ofstream g;
g.open("fact.out");
f>>a;
b=5;
s=0;
while (s<a)
{b1=b;
while (b1%5==0) { s++; b1/=5; }
b+=5;
}
if (a==0) b=6;
g<<b-5;
g.close();
return 0;
}