结构体输出语法有哪些问题?

#include <stdio.h>
#include <string.h>

struct student
{
    int number;
    char name[99];
    int math;
    int english;
    int program;
    int physics;
};

int main()
{
    int n = 0;
    scanf("%d", &n);
    struct student all[n];
    for(int i = 0; i < n; i++)
    {
        scanf("%d%s%d%d%d%d", &all[i].number, all[i].name, &all[i].math, &all[i].english, &all[i].program, &all[i].physics);
    }
    char simple[99];
    gets(simple);
    int q = 0;
    for(int i = 0; i < n; i++)
    {
        if(strcmp(all[i].name, simple) == 0)
        {
            printf("%d%s%d%d%d%d", all[i].number, all[i].name, all[i].math, all[i].english, all[i].program, all[i].physics);
            q++;
        }
    }
    if(q == 0)
    {
        printf("Not Found!");
    }
    return 0;
}

请问这段代码输入的问题是什么?输入n后不能输入得到四个结构体数组,初学者语法问题不清楚,xie'xie

你这代码都运行不了吧,定义数组时的下表必须是常量的,你的

struct student all[n];

这里的n是变量,编译会报错的。