Cod sursa(job #2853776)
Utilizator | Data | 20 februarie 2022 16:53:23 | |
---|---|---|---|
Problema | Factorial | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 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;
while(aux%5==0)
{
aux=aux/5;
n--;
}
}
gout<<m;
}
}