Cod sursa(job #1325782)
Utilizator | Data | 24 ianuarie 2015 12:52:37 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int n=1,p,ok,nr5=0,i,j,cop;
fin>>p;
i=1;
ok=1;
while(ok==1){
cop=i;
while(cop%5==0)
{nr5++;
cop/=5;}
if(nr5==p)
{ok=0;
fout<<i<<" ";}
i++;}
return 0;
}