Cod sursa(job #577472)
Utilizator | Data | 10 aprilie 2011 12:29:00 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int n,p,i,s;
int main()
{f>>p;
while(p)
{i++;n*=i;s=i;
if(s%5==0)
while(s%5==0)
{ s=s/5;
p--;
}
}
g<<i;
f.close();
g.close();
return 0;
}