Pagini recente » Cod sursa (job #2752943) | Cod sursa (job #1344681) | Cod sursa (job #2811287) | Cod sursa (job #3270900) | Cod sursa (job #730569)
Cod sursa(job #730569)
#include <fstream>
#include <cmath>
using namespace std;
int i,n,p,x;
ifstream in("fact.in");
ofstream out("fact.out");
int pow(int base, int power) {
if (power == 0) return 1;
if (power == 1) return base;
if (power % 2 == 0) return pow(base * base, power / 2);
if (power % 2 == 1) return base * pow(base * base, power / 2);
}
int main()
{
in >> p;
x = pow(10,p);
n=1;
while(n%x!=0)
{
++i;
n *= i;
}
out<<i;
in.close();
out.close();
}