Mai intai trebuie sa te autentifici.
Cod sursa(job #2711480)
Utilizator | Data | 24 februarie 2021 10:54:38 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.65 kb |
#include <fstream>
#include <climits>
using namespace std;
ifstream fi("fact.in");
ofstream fo("fact.out");
int n;
int nrz(int n)
{
int rez=0,p=5;
while(p<=n)
{
rez+=n/p;
p*=5;
}
return rez;
}
int main()
{
fi>>n;
fi.close();
for(int i=1;i<=INT_MAX;i++)
if(nrz(i)==n)
{
fo<<i;
break;
}
fo.close();
return 0;
}