Cod sursa(job #1769426)
| Utilizator | Data | 2 octombrie 2016 15:25:39 | |
|---|---|---|---|
| Problema | Factorial | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main ()
{
long long n, i, nr=0, k, x;
in>>n;
if(n==0) {out<<1; return 0;}
for (i=5; i<=100000000000000; i=i+5)
{
k=i;
while (k%5==0)
{
k=k/5;
n--;
}
if (n<=0) {out<<i; return 0;}
}
}
