学生管理系统源代码求学生宿舍管理系统 源代码?
学生管理系统源代码 时间:2022-02-23 阅读:(
)
求学生宿舍管理系统 源代码?
/* Note:Your choice is C IDE */ #include<stdio.h> #include<malloc.h> #define LEN sizeof(struct student) int m; struct student { long num; char name[20]; char addr[30]; char xueli[20]; struct student *next; }; void main() { int n,w; struct student *head=0; void print(struct student *head); struct student *creat(); struct student *add(struct student *head); struct student *del(struct student *head); struct student *search(struct student *head); system("cls"); do { printf(" *******************************************
"); printf(" *** Student Information Management System***
"); printf(" ********************************************
"); printf(" **** choose ********************
"); printf(" **** 1 Enter new data *************
"); printf(" **** 2 Modify data **************
"); printf(" **** 3 Search by people .xueli and num ****
"); printf(" **** 4 Browse data *****************
"); printf(" **** 5 add data ************
"); printf(" **** 6 Exit *************
"); printf(" ******************************************
"); printf(" *******************************************
"); printf("choose your number(1-6):[ ]"); do { scanf("%d",&n); if(n>6||n<1) { w=1; printf("Error,please input again(1-6):"); } else w=0; }while(w==1); switch(n) { case 1:head=creat();break; case 2:del(head);break; case 3:search(head);break; case 4:print(head);break; case 5:add(head);break; case 6:exit(0); } }while(n!=6); } struct student *creat() { struct student *head; struct student *p1,*p2; m=0; p1=p2=(struct student *)malloc(LEN); printf("Please input number:"); scanf("%ld",&p1->num); printf("Please input name:"); scanf("%s",p1->name); printf("address:"); scanf("%s",p1->addr); printf("xueli:"); scanf("%s",p1->xueli); while(p1->num!=0) { m=m+1; if(m==1)head=p1; else p2->next=p1; p2=p1; p1=(struct student *)malloc(LEN); printf("number:"); scanf("%ld",&p1->num); printf("name:"); scanf("%s",p1->name); printf("address:"); scanf("%s",p1->addr); printf("xueli:"); scanf("%s",p1->xueli); } p2->next=0; print(head); return(head); } struct student *del(struct student *head) { long num; struct student *p1,*p2; if(head==0) { printf("
list null
"); exit(0); } p1=head; printf("Which number do you want del:"); scanf("%ld",&num); while(num!=p1->num&&p1->next!=0) { p2=p1; p1=p1->next; } if(num==p1->num) { if(p1==head)head=p1->next; else p2->next=p1->next; printf("delete:%ld
",num); m=m-1; } else printf("%ld not been found!
",num); print(head); return(head); } struct student * add(struct student * head) { struct student *p0,*p1,*p2; p0=(struct student *)malloc(LEN); printf("number:"); scanf("%ld",&p0->num); printf("name:"); scanf("%s",p0->name); printf("address:"); scanf("%s",p0->addr); printf("xueli:"); scanf("%s",p0->xueli); p1=head; if(head==0) { head=p0; p0->next=0; } else { while((p0->num>p1->num)&&(p1->next!=0)) { p2=p1; p1=p1->next; } if(p0->num<=p1->num) { if(head==p1)head=p0; else p2->next=p0; p0->next=p1; } else { p1->next=p0; p0->next=0; } } m=m+1; print(head); } void print(struct student *head) { struct student *p; printf("
Now,There %d records are:
",m); p=head; if(head!=0) do { printf("%ld ",p->num); printf("%s ",p->name); printf("%s ",p->addr); printf("%s
",p->xueli); p=p->next; }while(p!=0); } struct student *search(struct student *head) { int n,w; struct student *name(struct student *head); struct student *number(struct student *head); struct student *xueli(struct student *head); printf("***** 7 use name to search****
"); printf("***** 8 use number to search****
"); printf("***** 9 use xueli to search****
"); printf("choose your number[ ]"); do { scanf("%d",&n); if(n>9||n<7) { w=1; printf("error,please input again:"); } else w=0; }while(w==1); switch(n) { case 7:name(head);break; case 8:number(head);break; case 9:xueli(head);break; } } struct student *name(struct student *head) { char nam[20]; int w; struct student *p1; printf("Please input name:"); scanf("%s",nam); if(head==0) { printf("
list null
"); exit(0); } p1=head; while(strcmp(nam,p1->name)!=0&&p1->next!=0) { p1=p1->next; w=0; } if(strcmp(nam,p1->name)==0) { printf("%ld %s %s %s
",p1->num,p1->name,p1->addr,p1->xueli); w=1; } if(w==0)printf("%s not been found!
",nam); } struct student *number(struct student *head) { long num; int w=0; struct student *p1; printf("please input the number:"); scanf("%ld",&num); if(head==0) { printf("
list null!
"); exit(0); } p1=head; while(p1->next!=0) { if(num==p1->num) { w=1; printf("%ld %s %s %s
",p1->num,p1->name,p1->addr,p1->xueli); } p1=p1->next; } if(w==0)printf("%ld not been found!
",num); } struct student *xueli(struct student *head) { struct student *p1; char xue[20]; int w=0; if(head==0) { printf("
list null
"); exit(0); } printf("please input xueli:"); scanf("%s",xue); p1=head; while(p1->next!=0) { if(strcmp(xue,p1->xueli)==0) { printf("%ld %s %s %s
",p1->num,p1->name,p1->addr,p1->xueli); w=1; } p1=p1->next; } if(w==0)printf("%s not been found
",xue); }
3C云互联怎么样?3C云互联专注免备案香港美国日本韩国台湾云主机vps服务器,美国高防CN2GIA,香港CN2GIA,顶级线路优化,高端品质售后无忧!致力于对互联网云计算科技深入研发与运营的极客共同搭建而成,将云计算与网络核心技术转化为最稳定,安全,高速以及极具性价比的云服务器等产品提供给用户!专注为个人开发者用户,中小型,大型企业用户提供一站式核心网络云端服务部署,促使用户云端部署化简为零,轻松...
华为云怎么样?华为云用在线的方式将华为30多年在ICT基础设施领域的技术积累和产品解决方案开放给客户,致力于提供稳定可靠、安全可信、可持续创新的云服务,做智能世界的“黑土地”,推进实现“用得起、用得好、用得放心”的普惠AI。华为云作为底座,为华为全栈全场景AI战略提供强大的算力平台和更易用的开发平台。本次年终聚惠618活动相当给力,1核2G内存1m云耀云服务器仅88元/年起,送主机安全基础版套餐,...
妮妮云的来历妮妮云是 789 陈总 张总 三方共同投资建立的网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑妮妮云的市场定位妮妮云主要代理市场稳定速度的云服务器产品,避免新手购买云服务器的时候众多商家不知道如何选择,妮妮云就帮你选择好了产品,无需承担购买风险,不用担心出现被跑路 被诈骗的情况。妮妮云的售后保证妮妮云退款 通过于合作商的友好协商,云服务器提供2天内全额退款,超过2天不退款 物...
学生管理系统源代码为你推荐
身份证系统电子身份证如何办理刷ip流量一天可以刷一万IP流量的软件方正证券官方网方正证券同花顺下载/2010同花顺官方网站/同花顺官方网站首页医院排队系统医院排队叫号系统有哪些功能?za是哪个国家的ci是在哪个国家产生的?哪个国家开始流行的yui3yui 3 月9日 出的专辑的情报erp系统教程如何使用ERP系统操作?东兴证券网站东兴证券交易软件如何操作?flex是什么这些b365m和b360m什么意思flushesno-show rate是什么
美国域名注册 荷兰服务器 jsp主机 linkcloud 512m 最好的空间 建立邮箱 刀片式服务器 东莞数据中心 免费美国空间 免费测手机号 安徽双线服务器 阿里云官方网站 cxz 主机管理系统 php服务器 摩尔庄园注册 免费php空间 中国联通宽带测试 网站防护 更多