Cod sursa(job #584049)
Utilizator | Data | 23 aprilie 2011 19:28:20 | |
---|---|---|---|
Problema | Factorial | Scor | 35 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int a,b,p,x,y,n,i,k;
int main()
{
i=5;
f>>p;
while (1==1)
{
x=i;
while (x%5==0)
{
k=k+1;
x=x/5;
}
if (k>=p) break;
i=i+5;
}
g<<i;
f.close();
g.close();
return 0;
}