学生管理系统源代码求学生宿舍管理系统 源代码?
学生管理系统源代码 时间: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); }
近期联通CUVIP的线路(AS4837线路)非常火热,妮妮云也推出了这类线路的套餐以及优惠,目前到国内优质线路排行大致如下:电信CN2 GIA>联通AS9929>联通AS4837>电信CN2 GT>普通线路,AS4837线路比起前两的优势就是带宽比较大,相对便宜一些,所以大家才能看到这个线路的带宽都非常高。妮妮云互联目前云服务器开放抽奖活动,每天开通前10台享3折优惠,另外...
LayerStack(成立于2017年),当前正在9折促销旗下的云服务器,LayerStack的云服务器采用第 3 代 AMD EPYC™ (霄龙) 处理器,DDR4内存和企业级 PCIe Gen 4 NVMe SSD。数据中心可选中国香港、日本、新加坡和洛杉矶!其中中国香港、日本和新加坡分为国际线路和CN2线路,如果选择CN2线路,价格每月要+3.2美元,付款支持paypal,支付宝,信用卡等!...
cyun怎么样?cyun蓝米数据是一家(香港)藍米數據有限公司旗下品牌,蓝米云、蓝米主机等同属于该公司品牌。CYUN全系列云产品采用KVM架构,SSD磁盘阵列,优化线路,低延迟,高稳定。目前,cyun推出的香港云服务器性价比超高,香港cn2 gia云服务器,1核1G1M/系统盘+20G数据盘,低至29元/月起;香港多ip站群云服务器,16个ip/4核4G仅220元/月起,希望买香港站群服务器的站长...
学生管理系统源代码为你推荐
dnf装备代码DNF代码,装备,不是EX存储区域网络nas、das、san 三种网络环境的区分暴力破解rar暴力破解rar,一个15位左右的密码,得用多长时间。(双核。2g内存)listviewitemListView具有多种item布局pat是什么格式pat 格式的文件用什么软件打开?netbios协议NETBEUI协议有什么用?网站客服代码怎么在网页用HTML代码设置QQ客服腾讯合作伙伴大会从微信同程旅行买的机票怎么打印电子发票?particular教程AE的particular的particle设置backupexec如何在Backup Exec 2012中添加要备份的Windows服务器
hawkhost 全球付 iisphpmysql godaddy域名优惠码 godaddy 嘉洲服务器 网站卫士 100m独享 qq云端 免费测手机号 华为云服务登录 杭州电信宽带 免费获得q币 标准机柜 机柜尺寸 cloudflare 德国代理ip bwg 挂马检测工具 免费php空间申请 更多