Cod sursa(job #2853774)
Utilizator | Data | 20 februarie 2022 16:52:09 | |
---|---|---|---|
Problema | Factorial | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("fact.in");
ofstream gout("fact.out");
int main()
{
long long int n,m,aux;
int c;
fin>>n;
m=0;
if(n==0)
{
gout<<1;
}
else
{
while(n!=0)
{
m=m+5;
aux=m;
c=0;
while(aux%5==0)
{
aux=aux/5;
c++;
}
n=n-c;
}
gout<<m;
}
}