i<2时两个人可以为什么i<3超过三个人就不行了呢
#include<stdio.h>struct student_record
{
char name[20];
int birthday;
int student_ID;
};
int main()
{
int i,j;
struct student_record person[i];
for(;i<4;i++)
{
printf("请输入学生姓名,学号,生日\n");
scanf("%s %d %d",person[i].name,&person[i].student_ID,&person[i].birthday);
}
struct student_record temp;
for(;j<4;j++)
{
for(;i<4;i++)
{
if(person[i].student_ID>person[i+1].student_ID)
{
temp=person[i];
person[i]=person[i+1];
person[i+1]=temp;
}
}}
for(i=0;i<4;i++)
{
printf("%s %d %d\n",person[i].name,person[i].student_ID,person[i].birthday);
}
}