Pagini recente » Cod sursa (job #725509) | Cod sursa (job #1370704) | Cod sursa (job #2129547) | Cod sursa (job #2356826) | Cod sursa (job #670134)
Cod sursa(job #670134)
#include<stdio.h>
using namespace std;
int cont;
int nrdiv(int x)
{
while((x!=1) && (x%5==0))
{
x=x/5;
cont++;
}
}
int main()
{
int p,i;
i=0;
cont=0;
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
scanf("%d",&p);
if(p<=0)
printf("-1");
else
{
while(cont!=p)
{
i=i+5;
nrdiv(i);
}
printf("%d",i);
}
fclose(stdin);
fclose(stdout);
return 0;
}