刚入门C,编程出了点问题,请高手解答下面程序的错误。

#include
#include

#define M 4

struct student
{
int num;
float weight;
float height;
float score;
};

int main()
{
int m,n,i,j,k;
struct student st[M];

while(1)
{
    printf("1:输入\t2:查看\t3:退出\n");
    printf("请输入: ");
    scanf("%d",&m);
    getchar();

    if(1==m)
    {
            printf("您要输入几个学生的信息?");
            scanf("%d",&n);
            for(i=0;i<n;i++)
                scanf("%d\t%f\t%f\t%f\n",&st[i].num,&st[i].weight,&st[i].height,&st[i].score);
    }

    if(2==m)
    {
        for(i=0;i<n;i++)
            printf("%d\t%f\t%f\t%f\n",st[i].num,st[i].weight,st[i].height,st[i].score);
    }

    if(3==m)
        goto out;
}

out:
return 0;
}

索引的index是不是从0开始的

重复的问题不要发很多次。