Runtime error sig segv

#include<stdio.h>
#include<math.h>
long long int trailing_factorial_zeros(long long int n)
{
int m=5, result = 0;
do
{
result = result+floor(n/m);
m=m*5;
}
while(n>m);
return result;
}
int main()
{
int k, i=0;
scanf("%d\n", &k);
long long int a[1000];
for(i=0;i<k;i++)
{
scanf("%lld\n", &a[i]);
a[i]=trailing_factorial_zeros(a[i]);
}
for(i=0;i<k;i++)
{
printf("%lld\n", a[i]);
}
return 0;
}

please help!!!

1.Paste it to pastebin.com (indent it carefully).
2.Than give us link to your code on pastebin.

//