Cod sursa(job #2075205)
| Utilizator | Data | 25 noiembrie 2017 11:53:56 | |
|---|---|---|---|
| Problema | Factorial | Scor | 25 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int p, x, z, n = 5, n2;
bool ok = true;
int main()
{
in >> p;
while(z < p) {
n2 = n;
while(n2%5 == 0) {
n2 = n2/5;
z++;
}
n += 5;
}
out << n-5;
return 0;
}
