C语言结构体的代码运行错误

写到一个结构体的题目,我在编译器上运行没问题,测试用例也是对的,但提交后显示
运行错误,不知道哪出错了。
题目网址:http://acm.zzuli.edu.cn/problem.php?id=1180
网站:ZZULIOJ 第1180题

#include 

struct ppp
{
    char num[15];
    char name[22];    
    int a, b, c;
    int sum;
};

int main(void)
{
    struct ppp stu[120];
    int n, i, max, remb;
    scanf("%d", &n);
    
    for (i = 0; i <= n - 1; i ++)
    {
        scanf("%s%s%d%d%d",stu[i].num, stu[i].name, 
                &stu[i].a, &stu[i].b, &stu[i].c);
        stu[i].sum = stu[i].a + stu[i].b + stu[i].c;
        if (stu[i].sum > max)
        {
            max = stu[i].sum;
            remb = i;
        }
    }
    
    printf("%s %s %d %d %d\n", stu[remb].num, stu[remb].name, 
            stu[remb].a, stu[remb].b, stu[remb].c);
    
    return 0;
}

运行结果:
Runtime Error:Segmentation fault
Segmentation fault:段错误,检查是否有数组越界,指针异常,访问到不应该访问的内存区域

希望找到错误的地方

max没有初值。

#include<stdio.h> 
struct ppp
{
    char num[15];
    char name[22];    
    int a, b, c;
    int sum;
};
int main(void)
{
    struct ppp stu[120];
    int n, i, max, remb;
    scanf("%d", &n);
    for (i = 0; i <= n - 1; i ++)
    {
        scanf("%s%s%d%d%d",stu[i].num, stu[i].name, 
                &stu[i].a, &stu[i].b, &stu[i].c);
        stu[i].sum = stu[i].a + stu[i].b + stu[i].c;
    }
    max=stu[0].sum;
    remb=0;
    for(i=1;i<n;i++)
    {
         if (stu[i].sum > max)
        {
            max = stu[i].sum;
            remb = i;
        }
    }
    printf("%s %s %d %d %d\n", stu[remb].num, stu[remb].name, 
            stu[remb].a, stu[remb].b, stu[remb].c);
    return 0;
}


max你没有初始化吧。int n,i,max=0,remb;