Cod sursa(job #1012026)
Utilizator | Data | 17 octombrie 2013 21:49:04 | |
---|---|---|---|
Problema | Factorial | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int P;
void Solve()
{
int i=5,Sol=0;
while(Sol<P)
{
int aux=i;
while(aux%5==0)
aux/=5,Sol++;
i+=5;
}
if(P==0)
g<<1<<"\n";
else
g<<i-5<<"\n";
}
int main()
{
f>>P;
Solve();
return 0;
}