匿名用户
1级
2012-06-20 回答
同学你参照下,有不懂的,百度上Hi我
#include
#include
#include
#include
struct sc
{
int chinese;
int maths;
int english;
};
typedef struct node
{
int num;
char name[20];
struct sc score;
struct node *next;
}st;
int menu()//菜单
{
int choice;
do{
system("cls");
printf("\t1.input the messega about a student\n");
printf("\t2.insect a messega of a new student\n");
printf("\t3.look for the messega\n");
printf("\t4.dellect the messega\n");
printf("\t5.arranging base on the number of learning\n");
printf("\t6.output all the messega\n");
printf("\t7.arranging base on all scores\n");
printf("\t8.exit the system\n");
printf("\tplease input your choice:");
scanf("%d",&choice);
}while(choice>7&&choice<1);
return choice;
}
st *create()//创建链表
{
st *head,*p,*tail;
char c;
head=tail=NULL;
while(c!='n'&&c!='N')
{
p=(st *)malloc(sizeof(st));
p->next=NULL;
printf("\t\tplease input the number of learning:");
scanf("%d",&p->num);
printf("\t\tplease input the name:");
scanf("%s",p->name);
printf("\t\tplease input the score of chinese:");
scanf("%d",&p->score.chinese);
printf("\t\tplease input the score of maths:");
scanf("%d",&p->score.maths);
printf("\t\tplease input the score of english:");
scanf("%d",&p->score.english);
if(head==NULL)
he