装修问答

C语言程序设计学生信息管理系统?


if((fin=find_name(stu;查找输出name
case 5;
}
/
strcpy(pi->
printf(":\**********查找链表num**********/
}
if(strcmp(str;);/putchar(10);
while(tail->name.;num;next;/用户操作
do
{
printf("););
strcpy(pi->no records;
}
/n"tsum\break;n".2f;
return p!=0)
{
front=p;t".\
putchar(10);
print_a_node(p);
}
/\;)!=NULL)
{
if(strcmp(p->,char name[])
{
STU *p=stu;);
scanf("
}
print_a_head();n"
break;avg=temp,
avg:
print_menu_list();n[9]-->);
temp!=NULL)
{
printf(":\
/List create end;List creating;next)
{
if(max->
}
printf("!\n".\);%f";please input the '0||cas>n\,a);)。
**********************************************************/更新链表单元
case 7;print the list\SN:
if(stu==NULL){printf("n"update end;
/);can not do this operation;/,fin->n[1]-->
default,str);
/
if(stu==NULL)
{
printf("delete a list node\!\%s"putchar(10);no"
do
{
printf("
char a[10];please input the ',*pf;score[i]);
p->!\
}STU;打印链表操作菜单
case 9;
return stu;
max->**********查找链表name**********/!\
order(stu);score[i].h>);
/
scanf("n"创建链表
case 1;
scanf(";
stu=creat_list();sum=0;
exit(0);%s",fin->n",*p;name);no found;
exit(0);n[4]-->sum;
max->!=NULL)
{
if(strcmp(p->,a);SN;
#include <n"
p->,fin->.\can not do this operation;);[6]-->t%0;n"
while(p;pi;
if(stu;
}
/can not do this operation;sum);next=p;n[8]-->num).name;打印操作提示
print_menu_list();
char str[4]!"can not do this operation;
int i.h>
printf(",name);can not find the student;======the operation menu list======\you must press 0 to 9 ;please input the new records now;n"n"now insert a list node;n\[0]-->i++)
{
scanf("putchar(10);
}
/
if((fin=find_name(stu;
void print_a_node(STU *fin)
{
int i!\:
if(stu==NULL){printf(");链表单元排序
case 8;%s")!\before update;tavg\operation end ;n\order the list by score\can not do this operation;n",*tail=NULL;n"************输出一个链表头部**********/n"break,cas);
strcpy(max->.\}
printf("next;
putchar(10);please input name;
break;)!=NULL)fre(stu);插入链表单元
case 3;n"/select by number\.;,int cas)
{
STU *fin=NULL,*pr=NULL;t%0;yes';next=p->
}
else printf("n"please input number;;
/,",*pj;yes"
}
void main()
{
STU *stu=NULL;);)==0)break;i++)
{
temp;next;;
}
p=stu;/num);
for(pj=pi->);
return (0).\update a list node\);n"name,
name[10]!=NULL)
{
print_a_head(););next.2f\!=NULL)p->,&p->avg=p->:\!;sum)
max=pj;SN.\!\!\
}
/
STU *find_num(STU *stu,a);}
printf("\
continue.;
free(p);i<num;;
p=p->getchar();avg;
}
/,*p;SN.num;}
tail->,char name[])
{
STU *p=stu;print the operation menu list\
/getchar();
/
break.;);
if(p;
tail=p;i<}
printf("%d",a)).,p->name;)!=NULL)
{
print_a_head();
/查找输出number
case 4;
strcpy(max->next;name););
}
p=creat_node();
if(cas==0){printf("
strcpy(temp;
printf(");sum<n"no) ;
void input(STU *p)
{
int i,p->no'n"
print_a_node(fin);
STU *find_name(STU *stu;Do you want to continue (yes/:\t%s,max->.;n";
}
else
printf(",*front=stu,name));putchar(10).\name'the delete record;break;n"
if(stu==NULL)
{
printf("stdio;/
/**********输入链表单元内容************/next=NULL;):2011-04-27
*程序名称,"fre(stu);
while(p;
}
if(max.\name')==0)
{
p=creat_node(),"
int cas;n\
break!=0)
{
printf("
printf(");/
#define SN 2 /
scanf("avg=pi->
if((p=find_name(stu;score[i]);
}
/;continue;
printf("输出链表
case 2;score%d\*********************************************************
*创建日期;/,i+1);
}
else printf("************释放链表**********/
/,char name[])
{
STU *fin;**********更新链表单元**********/,a);;
}
if(strcmp(str;score[i];pj,temp;
printf("next;
void order(STU *stu)
{
STU *pi.2f\.score[i];);n"/!\please input %d scores.\avg;%s"!=NULL)
{
printf(");continue;}
if(cas;no"
pi->
printf("
while(p;n"pj-> you want to find;
return stu;
}
STU * menu(STU *stu;n"%s"n"score[i]=pi->
p=(STU *)malloc(sizeof(STU));););
}
/
}
/,SN):
printf("
putchar(10);please input the '
printf("next;next=NULL;**********创建一个链表单元**********/
else front->
for(i=0;n\number\sum=temp.sum;);
break.h>You must input 'i++)
printf("!\
}
if(p==stu&&front==stu)stu=NULL;
p=pf;
if(p == NULL)
{printf(":\break;No enough memory ;/t"SN;
}
}
}
printf(" you want to update;press 0~9 to choose operation;putchar(10);/,temp!=NULL&&stu->n":以前写的;can not do this operation!\}
p=p->,temp!=NULL)
{
print_a_node(p);;
void print_a_head()
{
int i;
printf(",a)););}
print_list(stu);num);please input the '
p=p->next;
pi->n[3]--> you want to find;************插入链表单元************/!\putchar(10);
break;insert a list node\n[5]-->n"
printf("pi=pi->n"**********创建一个链表**********/
}
while(p.avg=max->科目数
typedef struct student
{
char num[10];);删除链表单元
case 6;
}
else
{
printf(" or '/break;
print_a_node(fin);score[i];
while(p;
if((fin=find_num(stu;
scanf("
pi->););sum,pi->.;select by name\
printf("
stu=delet(stu!\.;/);n"
return head;t");
print_a_head();number'!=NULL)
{
for(pi=stu;break;),*pr=NULL!=NULL)
{
pf=p->n".sum=pi->.,
sum;free the list;
}
return pr;************输出一个链表单元**********/
printf(",name)==0){pr=p;
/
print_a_node(fin);
for(i=0;putchar(10),fin->%s;
}
return stu,num)==0){pr=p:
if(stu==NULL){printf(":子夜星空
*备注信息;).;%0;n"\:\;order end;
}
input(p);
tail->
exit(0).score[i]=max->
break.;
scanf("
void insert(STU *stu)
{
STU *tail=stu;
}
p->
void update(STU *stu;
for(i=0;
switch(cas)
{
/break!=0)stu=menu(stu,name));n[7]-->:
if(stu;/do not need to order;
input(fin);n"can not do this operation;Insert end.num),max->
free(p);
}
else
{
printf("
break;name;
scanf(",&cas).;next)
{
max=pi;
}
return pr;n"):
if(stu==NULL){printf("!\:"!=NULL)
{
tail=tail->n"
int print_list(STU *stu)
{
STU *p=stu;name;);
/
break;creat a list\););**********链表单元排序**********/
}
/
STU * delet(STU *stu!;}
p=p->
#include <.;======the operation menu list======\9){printf("n"
STU *creat_list()
{
STU *head=NULL.avg!\!=0);can not do this operation;the list is NULL;exit\,"!\),char num[])
{
STU *p=stu:\order by score\can not find the student;
/,pi->************输出链表**********/
}while(1);
printf("no found;
}
putchar(10);break;);
print_a_head():
if(stu==NULL){printf("next!=pi)
{
strcpy(temp!=NULL&&strcmp(p->n",a);yes":链表综合操作
*程序作者;i<next=p..name);).!=0&&strcmp(str;
struct student *next;break;n"sum=max->i++)
printf("name);n\
if(head==NULL){head=tail=p;释放链表
fre(stu);num;
putchar(10).;
if(strcmp(str;string!=NULL;/delete end;n"n".;}
insert(stu);
}
/t"
printf("
#include <}
printf("!\
p->n"************删除链表单元************/
/n[2]-->
max->}
printf("pj=pj->:
if(stu==NULL){printf(":
if(stu==NULL){printf("n");n\
}
/next.;
STU *creat_node()
{
STU *p.\sum+=p-> you want to delete;stdlib!=NULL;avg;name':\),*max;score[i]=temp,fin->
for(i=0;
void print_menu_list()
{
printf("n"putchar(10);i<
}
if(stu==NULL)
printf("
return (0);break;%s"}
}while(cas;%s"/
temp,a);tname\sum/
void fre(STU *stu)
{
STU *p=stu;
if(cas<:\************输出操作菜单**********/num;
scanf(".\
update(stu;
float score[SN]

提拉米苏丫头 102024-06-06