Cod sursa(job #2154768)
Utilizator | Data | 7 martie 2018 11:56:18 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
int x=5,cx,i,n,nr0=0;
f>>n;
while(nr0<n)
{
cx=x;
while(cx%5==0 and nr0<n)
cx/=5,nr0++;
x+=5;
}
if(nr0==0)
g<<1;
else g<<x-5;
return 0;
}