这个运行起来会中断,不知道哪里出错,会是这样
怎么解决啊
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
typedef struct _Student
{
char banji; //班级
char ID[24]; //学号
char name[20]; //姓名
float mathScore; //高等数学成绩
float EnglishScore; //大学英语成绩
float Cscore; //C语言成绩
float averageScore; //考试平均成绩
int rank; //考试名次
float MutualEvaluationScore; //同学互评分数
float CounselorScore; //辅导员评分
float HeadTeacherScore; //班主任评分
float TheAll; //综合测评总分
int AllRank; //综合测评名次
}Student;
typedef struct _Node
{
Student stu;
struct _Node* pNext;
}Node;
Node *g_pHead=NULL;
void Input(); //1.录入
void Print(); //2.输出
void Write(); //3.保存
void Change(); //4.修改
void Delete(); //5.删除
void Find(); //6.查找
int Count(); //7.统计
int main()
{
char ch;
while(1)
{
printf("欢迎使用学生综合测评管理系统\n");
printf("1.录入学生信息\n");
printf("2.输出学生信息\n");
printf("3.保存学生信息\n");
printf("4.修改学生信息\n");
printf("5.删除学生信息\n");
printf("6.查找学生信息\n");
printf("7.统计所有学生人数\n");
printf("8.退出系统\n");
ch=getch();
switch(ch)
{
case '1': //录入学生信息
Input();
break;
case '2': //输出学生信息
Print();
break;
case '3': //保存学生信息
Write();
break;
case '4': //修改学生信息
Change();
break;
case '5': //删除学生信息
Delete();
break;
case '6': //查找学生信息
Find();
break;
case '7': //统计所有学生人数
printf("所有学生人数为%d。\n",Count());
system("pause");
system("cls");
break;
case '8': //退出系统
printf("收到!感谢使用!\n");
system("pause");
system("cls");
break;
default:
printf("您的输入有误,请按回车键重新输入!\n");
system("pause");
system("cls");
}
}
return 0;
}
void Input() //1.录入
{
Node pNewNode=(Node)malloc(sizeof(Node));
pNewNode->pNext=NULL;
if(g_pHead==NULL)
{
g_pHead=pNewNode;
}
else
{
pNewNode->pNext=g_pHead;
g_pHead=pNewNode;
}
printf("请输入学生的班级:\n");
scanf("%s",pNewNode->stu.banji);
printf("请输入学生的学号:\n");
scanf("%s",pNewNode->stu.ID);
printf("请输入学生的姓名:\n")
scanf("%s",pNewNode->stu.name);
printf("请输入学生的高等数学成绩:\n");
scanf("%f",&pNewNode->stu.mathScore);
printf("请输入学生的大学英语成绩:\n");
scanf("%f",&pNewNode->stu.EnglishScore);
printf("请输入学生的C语言成绩:\n");
scanf("%f",&pNewNode->stu.Cscore);
printf("请输入学生的同学互评分数:\n");
scanf("%f",&pNewNode->stu.MutualEvaluationScore);
printf("请输入学生的辅导员评分:\n");
scanf("%f",&pNewNode->stu.CounselorScore);
printf("请输入学生的班主任评分:\n");
scanf("%f",&pNewNode->stu.HeadTeacherScore);
printf("学生信息录入成功。\n");
}
void Print() //2.输出
{
}
void Write() //3.保存
{
}
void Change() //4.修改
{
}
void Delete() //5.删除
{
}
void Find() //6.查找
{
}
int Count() //7.统计
{
}