Cod sursa(job #2287573)
Utilizator | Data | 22 noiembrie 2018 03:03:28 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
using namespace std;
ifstream fin("factorial.in");
ofstream gout("factorial.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;
}