Cod sursa(job #2292139)
Utilizator | Data | 28 noiembrie 2018 23:48:38 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main() {
int ok=1;
long long int z=0, x=0, p, y, i=0;
fin>>p;
if(p==0){
fout<<1;
return 0;
}
else
{
while((x+z)<p){
x++;
y=i;
i=x*5;
if(i%25==0)
while(i/5%5==0){
z++;
i/=5;
}
}
fout<<y+5;
}
return 0;
}