Cod sursa(job #1268637)
Utilizator | Data | 21 noiembrie 2014 10:34:56 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
int main()
{
long n, x = 0, f = 1;
fin >> n;
while (x < n)
{
int aux = f;
while (aux % 5 == 0)
{
x++;
aux /= 5;
}
f++;
}
f--;
fout << f;
return 0;
}