Cod sursa(job #1325787)
Utilizator | Data | 24 ianuarie 2015 12:54:40 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
using namespace std;
int exponent,p,n,x,y,s;
int main()
{
ifstream in("fact.in");
ofstream out("fact.out");
in>>p>>n;
s=0;
x=5;
while(s<p)
{
exponent=0;
y=x;
while(y%5==0)
{
exponent++;
y/=5;
}
s=s+exponent;
x=x+5;
}
out<<x-5;
in.close();
out.close();
return 0;
}