Cod sursa(job #2934299)
Utilizator | Data | 5 noiembrie 2022 20:02:55 | |
---|---|---|---|
Problema | Factorial | Scor | 50 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
//Factorial
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
int main()
{
long long xx,p,nr,x;
fin>>p;
if(p==0)
{
fout<<"1";
return 0;
}
x=5;
nr=0;
while(nr<p)
{
xx=x;
while(xx%5==0)
{
nr++;
xx=xx/5;
}
x=x+5;
}
x=x-5;
fout<<x;
return 0;
}