Cod sursa(job #1804149)
Utilizator | Data | 12 noiembrie 2016 11:50:10 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.66 kb |
#include <iostream>
#include <fstream>
using namespace std;
int a,i,p,k,x;
int main()
{
ifstream f("fact.in");
ofstream g("fact.out");
f >> k;
a=0;
while (a<=k)
{
for (long long i=1; i<=999999999999; ++i)
{
x=i;
if (x%5==0)
{
while (x%5==0)
{
a=a+1;
x=x/5;
}
if (a==k)
{
p=i;
break;
}
}
if (p==i) break;
}
if (a==k) g << p;
}
return 0;
}