Cod sursa(job #1247766)
Utilizator | Data | 23 octombrie 2014 18:19:19 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
#include <iostream>
using namespace std;
int main (){
int p,n=1,i=0,m;
ifstream f("fact.in");
f>>p; cout<<p<<" ";
while (i<p)
{n++;
if(n%5==0)
{m=n;
while(m%5==0)
{
m=m/5;
i++;
}
}
}
cout<<n;
ofstream g("fact.out");
g<<n;
f.close();
g.close();
return 0;
}