Cod sursa(job #3129342)
Utilizator | Data | 14 mai 2023 00:40:37 | |
---|---|---|---|
Problema | Factorial | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
#include <vector>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int n;
int main()
{
fin>>n;
if(n==0)
{
fout<<1;
return 0;
}
int d=5;
while(n!=0)
{
int k=0,cd=d;
while(cd%5==0)
{
k++;
cd/=5;
}
n-=k;
d+=5;
}
fout<<d-5;
}