69,371
社区成员
发帖
与我相关
我的任务
分享
建议把
while (Com == 'Y');
改成
while (Com == 'Y' || Com == 'y');
do
{
p2 = p1 = (struct Student *)malloc(LEN);
printf("请输入学号:");
fflush(stdin);//------------------刷新
scanf("%d", &p1->Num);
printf("\n");
printf("请输入姓名:");
scanf("%s", &p1->Name);
printf("\n");
printf("请输入性别:");
scanf("%s", &p1->Sex);
printf("\n");
printf("请输入成绩:");
scanf("%f", &p1->Score1);
printf("\n");
p2->Next = p1;
++StudentNum;
if (StudentNum == 1)
{
head = p1;
}
printf("继续输入?Y/N\n");
fflush(stdin);//------------------刷新
scanf("%c",&Com);
} while (Com == 'Y');