Cod sursa(job #2066205)
Utilizator | Data | 14 noiembrie 2017 19:34:23 | |
---|---|---|---|
Problema | Factorial | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out ("fact.out");
const int L=30;
int p;
int zero (int y)
{
int n=0;
while(y>=5)
{
n+=(y/=5);
}
return n ;
}
void caut_bin( )
{
int pas=1<<L,r=0;
while(pas!= 0)
{
if(zero(r+pas)<p)
r+=pas;
pas/=2;
}
out<<r+1;
}
int main()
{
in>>p;
caut_bin( );
return 0;
}