程序为什么错误
#include<cstdio>int main()
{ int n;
float b=0,c=0,d=0,e=0;
scanf("%d",&n);
int a[n+1];
for(int i=1;i<=n;++i)
scanf("%d",a[i]);
for(int i=1;i<=n;++i)
{
if((0<=a[i])and(a[i]<=18))
b+=1;
else if((19<=a[i])and(a[i]<=35))
c+=1;
else if((36<=a[i])and(a[i]<=60))
d+=1;
else if(61<=a[i])
e+=1;
}
b/=n;
c/=n;
d/=n;
e/=n;
printf("%.2f %.2f %.2f %.2f",b,c,d,e);
return 0;
}