Cod sursa(job #2287576)
| Utilizator | Data | 22 noiembrie 2018 03:18:10 | |
|---|---|---|---|
| Problema | Factorial | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream gout("fact.out");
int main()
{
int n, num = 1, cop;
fin >> n;
if (n)
{num = 0;
while (n)
{
num += 5;
cop = num;
while (cop % 5 == 0 && cop)
{
cop /= 5;
n--;
}
}
}
gout << num;
return 0;
}
