- 1、本文档共20页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
宿舍管理系统程序(Dormitory management system program)
宿舍管理系统程序(Dormitory management system program)
/ * 宿舍管理 * /
# includes stdio.h 引用库函数 / * * /
# includes stdlib.h
# includes ctype.h
# includes string.h
typedef 定义结构体数组 struct / * * /
{
char roomnum [4]; / * 房间号 * /
char bednum [2]; / * 床位号 * /
char num [10]; / * 学号 * /
char name [20]; / * 姓名 * /
} the student;
student room1 (1000); / * 结构体数组变量 * /
int menu select 菜单函数 _ () / * * /
{
char c;
do {
system (cls); / * 运行前清屏 * /
printf (\ t \ t★★★★★★学生宿舍管理系统★★★★★★ \ n); / * 菜单选择 * /
printf (\ t \ t§ 1. 输入记录 (\ n );
printf (\ t \ t§ 2. 显示记录 (\ n );
printf (\ t \ t§ 3. 按房间号排序并显示 (\ n );
printf (\ t \ t§ 4. 按学号排序并显示 (\ n );
printf (\ t \ t§ 5. 插入一条记录按学号排序并显示 (\ n );
printf (\ t \ t§ 6. 按姓名查找, 删除一条记录 (\ n );
printf (\ t \ t§ 7 查找并显示一个记录 (\ n);
printf (\ t \ t§ 8. 从文件中读入数据 (\ n );
printf (\ t \ t§ 9. 循环写入数据 (\ n );
printf (\ t \ t§ 0. 结束程序 (\ n );
printf (\ t \ t★★★★★★★★★★★★★★★★★★★★ \ n);
printf (\ t \ t请选择您要运行的选项按 (0 - 9):);
c = getchar (); / * 读入选择 * /
} while (c 0 | | c 9).
return (0); / * 返回选择 * /
}
int input (student room [], int n) 输入若干条记录 / * * /
{int i = 0;
char sign x [10]; / * x [10] 为清除多余的数据所用 * /
while (sign. = n sign. = n) / * 判断 * /
{
printf (\ t \ t房间号:); / * 交互输入 * /
scanf (\ t \ t% d , room [n + 1].roomnum);
printf (\ t \ t床位号:);
scanf (\ t \ t% s, room [n + i].bednum);
printf (\ t \ t学号:);
scanf (\ t \ t% s, room [n + i].num);
printf (\ t \ t姓名:);
scanf (\ t \ t% s, room [n + i].name);
gets (x); / * 清除多余的输入 * /
printf (\ t \ t是否继续输入? (y / n));
scanf (\ t \ t% c, sign); / * 输入判断 * /
the + +;
}
return (n + 1);
}
void display (student room [], int n) 显示所有记录 / * * /
{
int i;
printf (\ t \ t type: \ n ); / * 格式头 * /
printf (\ t \ t房间号 床位号 学号 姓名 \ n );
printf (\ t \ t type: \ n );
for (i = 1; in n + 1; i + +) / * 循环输入 * /
{
printf (\ t \ t% - 10s% - 10s% - 10s% - 20s \ n , room [- 1].roomnum, room [- 1].bednum, room [- 1].num, room [- 1].name);
if ( 1 % 10 = = 0) / * 每十个暂停 * /
{printf (\ t \ t type: \ n); / * 格式 * /
printf (\ t \ t );
system (pause)
您可能关注的文档
- 均衡器的调试(Equalizer debugging).doc
- 地质和地层年代表(Geological and stratigraphic year representation).doc
- 坎儿井(Karez).doc
- 地方网站的推广技巧(Promotion techniques for local websites).doc
- 坏消息的大豆产业(Bad news for the soybean industry).doc
- 坏道修复(mhdd).doc
- 块石片石区别(Stone rubble difference).doc
- 坚定三个自信,履行庄严承诺(Firmly three confidence, fulfill solemn commitment).doc
- 坚定信心 凝聚共识 落到实处(Strengthen confidence, unite consensus and implement it).doc
- 坚定信心营销 中小企业主动出击暖动市场(Firm confidence marketing, small and medium enterprises take the initiative to warm the market).doc
- 家长考生必读2012中考每月大事记_中考网(The parents of candidates must read 2012 monthly chronicle of senior high school entrance examination network _ senior high school entrance examination).doc
- 宿舍管理系统(Dormitory management system).doc
- 宿舍管-理-员工作总结(Dormitory management staff summary).doc
- 宿舍管理(Dormitory management).doc
- 宿舍网络组建方案(Dormitory network formation scheme).doc
- 宿舍规范(Dormitory specification).doc
- 宿舍限制大功率电器的原理及破解方案的探究(The principle of dormitory limited high-power electric appliance and the exploration of the crack scheme).doc
- 宿舍限电的解决办法(Solutions to power rationing in dormitories).doc
- 宿舍限电问题破解法(Dormitory power rationing problem crack method).doc
- 宿迁学院入门大攻略(Introduction to Suqian College).doc
文档评论(0)