Pagini recente » Cod sursa (job #2500679) | Cod sursa (job #3177302) | Cod sursa (job #1485345) | Cod sursa (job #179201) | Cod sursa (job #670189)
Cod sursa(job #670189)
#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,z;
z=-1;
i=0;
cont=0;
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
scanf("%d",&p);
if(p<0)
printf("%d",z);
else if(p==0)
printf("1");
else
{
while(cont!=p)
{
i=i+5;
nrdiv(i);
}
printf("%d",i);
}
fclose(stdin);
fclose(stdout);
return 0;
}