程序无法运行,应该怎么改正 c

img


这个程序输入够以后无法开始运行,还能继续进行输入,没办法进行程序及输出,请问哪里出错了啊?
输入样例是
9
88 74 101 26 15 0 34 22 77

b<N
不是b<=N,不然就是输入n+1个数了

有帮助请采纳

修改如下,供参考:

#include<stdio.h>
int main()
{
    int N,s,h,b;
    int a;
    scanf("%d",&N);
    for(s=0,h=0,b=0;b<N;b++){ //修改
        scanf("%d",&a);
        if(a%2==0)
            s++;
        else
            h++;
    }
    printf("%d %d",h,s);
    return 0;
}