Pagini recente » Cod sursa (job #910546) | Profil UPB_Bobulisteanu_Bobulisteanu_Nitu | Monitorul de evaluare | Cod sursa (job #414936) | Cod sursa (job #545969)
Cod sursa(job #545969)
#include<iostream.h>
#include<fstream.h>
int main()
{
ifstream f;
f.open("fact.in");
ofstream g;
g.open("fact.out");
int p, l=0, i=0;
f>>p;
int ok=0;
while(!ok)
{
int aux=i;
if (aux%5==0 && aux)
while(aux%5==0)
{
l++;
aux/=5;
}
if (l>=p) ok=1;
else i+=5;
}
if(l==p) g<<i;
else g<<-1;
f.close();
g.close();
return 0;
}