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

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

PacificRack:洛杉矶KVM月付1.5美元起,1G内存套餐年付12美元起

PacificRack在本月发布了几款特价产品,其中最低款支持月付仅1.5美元,基于KVM架构,洛杉矶机房,PR-M系列。PacificRack简称PR,QN机房旗下站点,主要提供低价VPS主机产品,基于KVM架构,数据中心为自营洛杉矶机房,现在只有PR-M一个系列,分为了2个类别:常规(Elastic Compute Service)和多IP产品(Multi IP Server)。下面列出几款秒...

HostDare($33.79/年)CKVM和QKVM套餐 可选CN2 GIA线路

关于HostDare服务商在之前的文章中有介绍过几次,算是比较老牌的服务商,但是商家背景财力不是特别雄厚,算是比较小众的个人服务商。目前主流提供CKVM和QKVM套餐。前者是电信CN2 GIA,不过库存储备也不是很足,这不九月份发布新的补货库存活动,有提供九折优惠CN2 GIA,以及六五折优惠QKVM普通线路方案。这次活动截止到9月30日,不清楚商家这次库存补货多少。比如 QKVM基础的五个方案都...

VirMach(8元/月)KVM VPS,北美、欧洲

VirMach,成立于2014年的美国IDC商家,知名的低价便宜VPS销售商,支持支付宝、微信、PayPal等方式付款购买,主打美国、欧洲暑假中心产品,拥有包括洛杉矶、西雅图、圣何塞、凤凰城在内的11个数据中心可以选择,可以自由搭配1Gbps、2Gbps、10Gbps带宽端口,有Voxility DDoS高防IP可以选择(500Gbps以上的防御能力),并且支持在控制面板付费切换机房和更换IP(带...

学生管理系统源代码为你推荐
isbackgroundbokeh是什么意思ico监管BTCB是什么?cursorlocation在ENVI中双击遥感图像出来个CURSOR LOCATION/value对话框。下面有个LL : 31?6'21.84"N, 117?9'11.78"E全局钩子求助:全局钩子是怎么回事啊?下载的游戏为什么会安装钩子?求大神帮助pass是什么锒行卡上的闪付pass是什么意思?driversbackup我的电脑d盘里有个Backup文件夹 怎么能让他显示出来全峰快递官网全峰快递公司的简介能了解一下吗商品编码查询系统如何用商品名称查询编码?wap服务中国联通用户怎么才能使用WAP服务取英文名的网站谁知道Debbie Lynne Cindy Carol Barbara 这几个英文名字的来历,说个可以查的网站也行,谢
台湾虚拟主机 江西服务器租用 淘宝抢红包攻略 荣耀欧洲 vpsio 天猫双十一抢红包 网站实时监控 ibox官网 亚马逊香港官网 支付宝扫码领红包 paypal注册教程 免费网络空间 大化网 mteam 免费的加速器 德国代理ip hp存储服务器 2000元电脑主机配置 杭州摇号申请网站 更多