第一范文网 - 专业文章范例文档资料分享平台

c语言课程设计报告+学生成绩信息管理系统+源代码

来源:用户分享 时间:2025/8/6 10:06:55 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

break;

default: printf(\选择错误,请重选!)\\n\getchar(); } } } void createlist(struct stucode **r) { struct stucode *p,*t; long n; char a[20]; char s[4]; char b[12]; char m[12]; if(*r) *r=NULL; printf(\请输入:\\n 学号(请按学号升序排列) 姓名 性别 出生日期 电话 (若要结束请输入五个为零) \\n\ scanf(\ if(n==0) return; p=(L *)malloc(sizeof(L)); p->student.num=n; strcpy(p->student.name,a); strcpy(p->student.sex,s); strcpy(p->student.birthday,b); strcpy(p->student.tel,m); p->next=NULL; *r=p;

scanf(\

while(n) { t=p;

p=(L *)malloc(sizeof(L)); p->student.num=n; strcpy(p->student.name,a); strcpy(p->student.sex,s); strcpy(p->student.birthday,b); strcpy(p->student.tel,m); p->next=NULL; t->next=p; scanf(\ } } void search1(struct stucode *r) { long x; if(!r) { printf(\没有学生信息可查询!\\n\ return ; }

printf(\请输入要查询的学生信息的学生学号:\\n\ scanf(\

while(r&&r->student.num!=x) r=r->next; if(r==NULL)

printf(\

else

printf(\nt.birthday,r->student.tel); }

void search2(struct stucode *r) {

int a=0,b=0,c=0; if(!r) { printf(\没有学生信息可统计!\\n\ return ; } else{ while(r) {a++; if(strcmp(r->student.sex,\男\if(strcmp(r->student.sex,\女\ r=r->next;} } printf(\共有学生%d人,其中男生%d人,女生%d人\} void del(struct stucode **r) { long k;

struct stucode *p=*r,*t; if(!(*r)) {

printf(\没有学生信息可删除 !\\n\ return ; }

printf(\请输入要删除的学生信息的学生学号:\\n\ scanf(\

if(p->student.num==k) *r=(*r)->next,free(p); else {

while(p->next&&p->next->student.num!=k) p=p->next; if(p->next==NULL) printf(\ else { t=p->next; p->next=p->next->next; free(t); } } } void insert(struct stucode **r) { long n; char a[20]; char s[4]; char b[12]; char m[12]; L *p,*t,*k;

printf(\请输入:\\n 学号(请按学号升序排列) 姓名 性别 出生日期 电话 (若要结束请输入三个为零) \\n\ scanf(\ p=(L *)malloc(sizeof(L)); p->student.num=n; strcpy(p->student.name,a); strcpy(p->student.sex,s); strcpy(p->student.birthday,b); strcpy(p->student.tel,m); if(!(*r)) { *r=p; (*r)->next=NULL; return ; } if(p->student.num<(*r)->student.num) p->next=(*r),(*r)=p; else { t=*r; k=t; while(t->next&&t->next->student.num<=p->student.num) t=t->next; p->next=t->next; t->next=p; *r=k; } }

void sort(struct stucode **r)

c语言课程设计报告+学生成绩信息管理系统+源代码.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2tuze4f8574n7xz5eecp3x5if1klf700ay9_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top