Cod sursa(job #600884)
Utilizator | Data | 3 iulie 2011 23:54:00 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ifstream in ("fact.in");
ofstream out ("fact.out");
int n, i, count, temp;
in >> n;
count = 0;
for (i = 1; i; ++i)
{
temp = i;
while (temp % 5 == 0)
{
temp /= 5;
count ++;
}
if (count == n)
{
out << i;
break;
}
}
return 0;
}