学生管理系统源代码求学生宿舍管理系统 源代码?
学生管理系统源代码 时间: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); }
这两天Linode发布了十八周年的博文和邮件,回顾了过去取得的成绩和对未来的展望。作为一家运营18年的VPS主机商,Linode无疑是有一些可取之处的,商家提供基于KVM架构的VPS主机,支持随时删除(按小时计费),可选包括美国、英国、新加坡、日本、印度、加拿大、德国等全球十多个数据中心,所有机器提供高出入网带宽,最低仅$5/月($0.0075/小时)。This month marks Linod...
每年的7月的最后一个周五是全球性质的“系统管理员日”,据说是为了感谢系统管理员的辛苦工作....friendhosting决定从现在开始一直到9月8日对其全球9个数据中心的VPS进行4.5折(优惠55%)大促销。所有VPS基于KVM虚拟,给100M带宽,不限制流量,允许自定义上传ISO...官方网站:https://friendhosting.net比特币、信用卡、PayPal、支付宝、微信、we...
Friendhosting发布了针对“系统管理日”(每年7月的最后一个星期五)的优惠活动,针对VPS主机提供55%的优惠(相当于四五折),支持1-6个月付款使用,首付折扣非永久,优惠后最低套餐首半年7.18欧元起。这是一家保加利亚主机商,成立于2009年4月,商家提供VDS和独立服务器租用等,数据中心目前可选美国洛杉矶、保加利亚、乌克兰、荷兰、拉脱维亚、捷克和波兰等8个地区机房。下面以最低套餐为例...
学生管理系统源代码为你推荐
订房系统什么是酒店客房控制系统?youtube创始人鬼步舞创作者是谁暴力破解rar暴力破解rar,一个15位左右的密码,得用多长时间。(双核。2g内存)网络安全密钥网络安全密钥和wifi密码有什么区别网站客服代码如何将在线客服代码插入到您的网页中?短信套餐中国移动发短信有什么套餐比较好backupexecBackup Exec 2014怎么备份Exchangevaliddate怎样解决oracle报错is not a valid date and time微盟价格为什么这么多人用微盟,微盟都有哪些优势driversbackup电脑里有个“Backup”文件夹是干什么的
鲁诺vps 星星海 z.com 搬瓦工官网 isatap idc评测网 68.168.16.150 正版win8.1升级win10 parseerror 免费个人博客 地址大全 申请个人网页 linux空间 大容量存储器 域名转向 双拼域名 北京双线机房 谁的qq空间最好看 国外代理服务器软件 佛山高防服务器 更多