本人写了个程序,,但是运行不出来,,谁能帮我看看,,我是个学生,,多多指点哈
#include"stdio.h"#include"stdlib.h"
#include"string.h"
typedef struct STUDENT
{
char name[20];
int num[10];
int score;
char birth[10];
char sex[2];
char nationality[10];
struct STUDENT *next;
}STUDENT, *StudentList;
void create(StudentList &L);
void search(StudentList &L);
void insert(StudentList &L);
void printList(StudentList &H);
#include"create.cpp"
#include"insert.cpp"
#include"locate.cpp"
void Sum(StudentList H)
{
printf("学生成绩统计\n");
StudentList t=H->next;
if(!t)
{
printf("信息系统空\n");
return ERROR;
}
printf("不及格的学生是:\n");
printf("姓名:\n学号:\n成绩:\n出生日期:\n性别:\n民族:\n");
while(t)
{
if (t->score<60)
{
printf("%s,%d,%d,%s%s,%s",p->name,p->num,p->score,p->birth,p->sex,p->nationality");
}
t=t->next;
}
t=H->next;
printf("成绩为"及格"的学生是:\n");
printf("姓名:\n学号:\n成绩:\n出生日期:\n性别:\n民族:\n");
while(t)
{
if (t->score>=60&&t->score<=70)
{
printf("%s,%d,%d,%s,%s,%s",p->name,p->num,p->score,p->birth,p->sex,p->nationality");
}
t=t->next;
}
t=H->next;
printf("成绩为"中"的学生是:\n");
printf("姓名:\n学号:\n成绩:\n出生日期:\n性别:\n民族:\n");
while(t)
{
if (t->score>=70&&t->score<80)
{
printf("%s,%d,%d,%s,%s,%s",p->name,p->num,p->score,p->birth,p->sex,p->nationality");
}
t=t->next;
}
t=H->next;
printf("成绩为"良"的学生是:\n");
printf("姓名:\n学号:\n成绩:\n出生日期:\n性别:\n民族:\n");
while(t)
{
if (t->score>=80&&t->score<90)
{
printf("%s,%d,%d,%s,%s,%s",p->name,p->num,p->score,p->birth,p->sex,p->nationality");
}
t=t->next;
}
t=H->next;
printf("成绩为"优"的学生是:\r\n");
printf("姓名:\n学号:\n成绩:\n出生日期:\n性别:\n民族:\n");
while(t)
{
if (t->score>=90)
{
printf("%s,%d,%d,%s,%s,%s",p->name,p->num,p->score,p->birth,p->sex,p->nationality");
}
t=t->next;
}
}
void printList(StudentList H)
{
StudentList t=H->next;
if(!t)
{
printf("信息系统空,请添加!\n");
return ;
}
printf("姓名:\n学号:\n成绩:\n出生日期:\n性别:\n民族:\n");
while(t)
{
printf("%s,%d,%d,%s,%s,%s",p->name,p->num,p->score,p->birth,p->sex,p->nationality");
t=t->next;
}
printf("\n");
}
void main()
{
StudentList H;
H = (StudentList )malloc(sizeof(STUDENT));
H->next = NULL;
while(1)
{
printf("\t\t\t\t学生成绩管理系统\t\t\t\t");
printf("1建立成绩链表\n2插入\n3查询\n4统计\n");
printf("请选择:");
switch(getchar())
{
case '1':
create(H);
break;
case '2':
insert(H);
break;
case '3':
locate(H);
break;
case '4':
Sum(H);
break;
}
}
}
是要用到数据结构的,,,学生信息管理