Cod sursa(job #217808)
| Utilizator | Data | 30 octombrie 2008 15:06:34 | |
|---|---|---|---|
| Problema | Factorial | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.28 kb |
//
#include<fstream.h>
#include<math.h>
ifstream f("fact.in");
ofstream g("fact.out");
long y,i,nr,x,p;
int main()
{f>>p;
x=0;
nr=0;
while (nr<p)
{x=x+5;
y=x;
while (y%5==0)
{y=y/5;
nr++;}
}
if (nr==p)
g<<x;
else
g<<"nu e bine";
f.close();
g.close();
return 0;}