Cod sursa(job #247998)
Utilizator | Data | 24 ianuarie 2009 17:30:52 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<stdio.h>
int main()
{
freopen ("fract.in","r",stdin);
freopen ("fract.out","w",stdout);
unsigned long int i=0,x=0,f,p;
scanf("%lu",&p);
while(x<p)
{
i++;
f=i*5;
while(f%5==0)
{
x++;
f=f/5;
}
}
if(p==0)
printf("1");
if(x==p && p!=0)
printf("5*%lu",&i);
else
printf("-1");
return 0;
}