In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use C language to realize student dormitory management system". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn "how to use C language to realize student dormitory management system"!
Realize the simple basic information management of the student dormitory, the basic information of the dormitory includes the building number, room number, area, the number of people accommodated, the number of people who have moved in, and so on. The system works in the form of text menu.
Login: the user name is asd and the password is arbitrary
# include # define N sizeof (struct Student) typedef struct Student {int buildnum; / / dormitory building int roomnum; / / room number int brnum; / / dormitory building number + room number float area; / / dormitory room area int rnanum; / / the number of people accommodated char xy [100]; / / College int bj / / Class int num; / / Student number char name [20]; / name char sex [10]; / / gender int date; / / date struct Student * next;} Stu,*stu;int a [1000000]; / / record the number of dormitory occupants void save_stu (stu p); void login () {system ("cls"); system ("color 4e") Printf ("\ n\ nWelcome to the student dormitory management system ~ # #\ n"); printf ("\ n\ n\ t\ t ★") Printf ("\ n\ t\ tLoading"); for (int item0) / / can only be deleted to a maximum of no characters such as continue;} if (! isdigit (password) & &! isalpha (password)) / / determine whether it is a number or character continue Putchar ('*'); / / print an asterisk on the screen} printf ("\ n\ n\ n = login success = ="); Sleep (600); return; system ("pause");} else {if (inext = p) P1 = p;}} if (pr! = NULL) pr- > next = NULL; else head = NULL; fclose (fp); / / close the file return head; / / return pointer} Student * input (int n) {int i; stu head,p,q If (n buildnum,&p- > roomnum,&p- > brnum,&p- > area,&p- > rnanum,&p- > xy,&p- > bj,&p- > num,&p- > name,&p- > sex,&p- > date); a [p-> brnum] +; if (a [p-> brnum] = = p-> rnanum) printf ("\ nThe dormitory is full, please arrange for the students behind to stay in other spare rooms\ n") Head = p; save_stu (p); for (I = 1
< n; i++) { q = (stu)malloc(sizeof(Stu)); printf("--------------------------------------------------------------------------------\n"); printf("楼栋号 房间号 楼栋房间号 房间面积 容纳数 学院 班级 学号 姓名 性别 日期\n"); printf("--------------------------------------------------------------------------------\n"); scanf("%d%d%d%f%d%s%d%d%s%s%d",&q->Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.