项目说明

本系统基于C语言开发,适用于刚入门的C语言新手项目课设,开发软件采用VC++6.0开发,VS,DEV C++等均可运行。

 

项目运行截图

C语言宿舍管理系统课设

 

 C语言宿舍管理系统课设

 

 C语言宿舍管理系统课设

 

 C语言宿舍管理系统课设

 

 C语言宿舍管理系统课设

 

 C语言宿舍管理系统课设

 

 C语言宿舍管理系统课设

 

 C语言宿舍管理系统课设

 

 代码界面截图

C语言宿舍管理系统课设

 

 

部分关键代码:

int find_check(stu *head,stu *p) //检查宿舍是否满员,符合返回1,不符合返回0

{

//print(head);   //测试

//printf("进入\n");

stu *i;

for(i=head->next;i!=NULL;i=i->next)

{

if(!strcmp(p->dorm,i->dorm)&&(p->dorm_num_id==i->dorm_num_id)&&(p->dorm_num==i->dorm_num))

{

printf("\t宿舍信息重复\n");

return 0;

}

}

return 1;

}

stu *creat()//创建链表

{

 

stu *head,*end,*p;

char id[10];

head=NULL;

head=(stu*)malloc(sizeof(stu));

head->next=NULL;

end=head;

printf("\t输入学号:");

fflush(stdin);

gets(id);

while(strlen(id)>0)

{

 

if(find_id(id,head))//学号查重,重复返回0,否则1

{

p=(stu*)malloc(sizeof(stu));

strcpy(p->id,id);

printf("\t输入姓名:");

gets(p->name);

printf("\t输入公寓名称:");

scanf("%s",p->dorm);

printf("\t输入宿舍名称:");

scanf("%d",&p->dorm_num);

printf("\t输入床位号:");

scanf("%d",&p->dorm_num_id);

if(find_check(head,p))  //检查宿舍是否满员,符合返回1,不符合返回0

{

printf("\t手机号:");

fflush(stdin);

gets(p->number);

printf("\t年龄:");

scanf("%d",&p->age);

printf("\t性别:");

scanf("%s",p->sex);

printf("\t专业班级:");

scanf("%s %d",p->major,&p->banji);

printf("\t输入入学年份:");

scanf("%d",&p->enUniversity);

end->next=p;

end=p;

p->next=NULL;

}

}

printf("\t输入学号:");

fflush(stdin);

gets(id);

}

return head;

}

 

获取完整代码:

https://max.book118.com/html/2020/1010/5123032014003010.shtm

https://wenku.baidu.com/view/63801a2067ce0508763231126edb6f1afe0071c1

相关文章:

  • 2021-12-31
  • 2021-11-17
  • 2021-06-26
  • 2021-07-15
  • 2021-10-16
  • 2021-08-12
猜你喜欢
  • 2021-11-27
  • 2021-12-15
  • 2021-11-09
  • 2021-12-03
  • 2021-11-09
  • 2021-10-29
相关资源
相似解决方案