Cod sursa(job #2137450)
Utilizator | Data | 20 februarie 2018 20:09:51 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
#include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
long long int n,ap=0,i,j,ap1=0;
bool ok=true;
int main()
{
fin>>n;
i=1;
ok=true;
int x;
while(ap!=n)
{
i++;
if(i%5==0)
{
x=i;
while(x%5==0)
{
ap++;
x=x/5;
}
}
}
fout<<i;
return 0;
}