PAT1015 不知道为什么输出不了

为什么没法输出东西呢



#include<stdio.h>

struct student
{
    char s[9];
    int d;
    int c;
    int sum;
};

int main()
{
    int N,L,H;
    int xh[4][100000],cnt[4];
    scanf("%d %d %d",&N,&L,&H);
    
    struct student stu[N];
    struct student *p=stu;
    
    void inputandsort(int N,struct student stu[],int xh[][100000],int cnt[],int H,int L);
    void paixu(struct student stu[],int xh[][100000],int cnt[]);
    
    inputandsort(N,p,xh,cnt,H,L);
    
    paixu(p,xh,cnt);

    printf("%d\n",cnt[0]+cnt[1]+cnt[2]+cnt[3]);
    
    for(int i=0; i<4; i++){
        for(int j=0; j<cnt[i]; j++) 
        printf("%s %d %d\n",stu[xh[i][j]].s,stu[xh[i][j]].d,stu[xh[i][j]].c);
    }
}

void inputandsort(int N,struct student stu[],int xh[][100000],int cnt[],int H,int L)
{
    for(int i=0; i<N; i++)
    {
        scanf("%s %d %d",&stu[i].s,&stu[i].d,&stu[i].c);
        stu[i].sum = stu[i].d + stu[i].c;
        if(stu[i].d >= L && stu[i].c >= L)
        {
            if( stu[i].d >= H && stu[i].c >= H ) xh[0][cnt[0]++]=i;
            else if( stu[i].d >= H ) xh[1][cnt[1]++] = i;
            else if( stu[i].d > stu[i].c ) xh[2][cnt[2]++] = i;
            else if( stu[i].d >= L && stu[i].c >= L ) xh[3][cnt[3]++] = i;
        }
        
    }
}

void paixu(struct student stu[],int xh[][100000],int cnt[])
{
    int i,j,k,t,m;
    for(i=0 ; i<4; i++)
    {
        for(j=0 ; j<cnt[i]; j++)
        {
            m=j;
            for(k=j+1; k<cnt[i]; k++)
            {
                if(stu[xh[i][k]].sum > stu[xh[i][m]].sum) m=k;
                if(stu[xh[i][k]].sum = stu[xh[i][m]].sum && stu[xh[i][k]].s < stu[xh[i][m]].s) m=k; 
            }
            if(m!=j) {
                t=xh[i][j];xh[i][j]=xh[i][m];xh[i][m]=t;
            }
        }
    }

}

scanf("%s %d %d",&stu[i].s,&stu[i].d,&stu[i].c);
改为
scanf("%s %d %d",stu[i].s,&stu[i].d,&stu[i].c);
字符串输入不需要取地址