Pagini recente » Cod sursa (job #1067543) | Cod sursa (job #608964) | Cod sursa (job #1772037) | Profil GiscaDiana | Cod sursa (job #113380)
Cod sursa(job #113380)
#include<stdio.h>
#include<math.h>
int main()
{
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
long int i,j,p,k;
j=0;
scanf("%ld",&p);
if (p==0)
{
printf("1");
return 0;
}
for (i=0;i<100000000;i=i+5)
{
k=i;
while (k%5==0 && i!=0)
{
j++;
k/=5;
}
if (p==j)
{
printf("%ld",i);
// gasit=0;
break;
}
if (j>p)
{
printf("-1");
return 0;
}
}
//if (gasit==1)
// printf("-1");
//fclose(stdin);
//fclose(stdout);
return 0;
}