学生管理系统源代码求学生宿舍管理系统 源代码?

学生管理系统源代码  时间: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); }

ReliableSite:美国服务器租用,洛杉矶/纽约/迈阿密等机房;E3-1240V6/64GB/1TSSD,$95/月

reliablesite怎么样?reliablesite是一家于2006年成立的老牌美国主机商,主要提供独服,数据中心有迈阿密、纽约、洛杉矶等,均免费提供20Gbps DDoS防护,150TB月流量,1Gbps带宽。月付19美金可升级为10Gbps带宽。洛杉矶/纽约/迈阿密等机房,E3-1240V6/64GB内存/1TB SSD硬盘/DDOS/150TB流量/1Gbps带宽/DDOS,$95/月,...

.asia域名是否适合做个人网站及.asia域名注册和续费成本

今天看到群里的老秦同学在布局自己的网站项目,这个同学还是比较奇怪的,他就喜欢用这些奇怪的域名。比如前几天看到有用.in域名,个人网站他用的.me域名不奇怪,这个还是常见的。今天看到他在做的一个范文网站的域名,居然用的是 .asia 后缀。问到其理由,是有不错好记的前缀。这里简单的搜索到.ASIA域名的新注册价格是有促销的,大约35元首年左右,续费大约是80元左右,这个成本算的话,比COM域名还贵。...

HostKvm:夏季优惠,香港云地/韩国vps终身7折,线路好/机器稳/适合做站

hostkvm怎么样?hostkvm是一家国内老牌主机商家,商家主要销售KVM架构的VPS,目前有美国、日本、韩国、中国香港等地的服务,站长目前还持有他家香港CN2线路的套餐,已经用了一年多了,除了前段时间香港被整段攻击以外,一直非常稳定,是做站的不二选择,目前商家针对香港云地和韩国机房的套餐进行7折优惠,其他套餐为8折,商家支持paypal和支付宝付款。点击进入:hostkvm官方网站地址hos...

学生管理系统源代码为你推荐
外国最火开放的直播app手机上看国外电视直播软件哪个好爱短信官网求助。爱短信爱聊怎么用?excel大写金额怎么在excel中设置大写金额sdfsdfsdfsdf小米手机投诉热线shoujiao如何区分是不是颈椎病?防火墙技术应用常用防火墙技术有哪几种泛微协同办公系统泛微OA系统怎么创建新人员acceptchangesaltium designer 6.0如何给元件重新编号网页背景音乐代码有没有网页背景音乐播放器代码??ps5教程跪求PS5 教程
burstnet inmotionhosting softbank官网 60g硬盘 iis安装教程 ssh帐号 美国php空间 网站实时监控 免费ftp空间申请 vip购优惠 空间合租 上海服务器 国外ip加速器 cloudlink 跟踪路由命令 免费asp空间申请 114dns 成都主机托管 腾讯网盘 杭州电信宽带 更多