- 1、本文档共20页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
宿舍管理系统程序(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
- [中央]2023年中国电子学会招聘应届生笔试历年参考题库附带答案详解.docx
- [吉安]2023年江西吉安市青原区总工会招聘协理员笔试历年参考题库附带答案详解.docx
- [中央]中华预防医学会科普信息部工作人员招聘笔试历年参考题库附带答案详解.docx
- [保定]河北保定市第二医院招聘工作人员49人笔试历年参考题库附带答案详解.docx
- [南通]江苏南通市崇川区人民法院招聘专职人民调解员10人笔试历年参考题库附带答案详解.docx
- [厦门]2023年福建厦门市机关事务管理局非在编工作人员招聘笔试历年参考题库附带答案详解.docx
- [三明]2023年福建三明市尤溪县招聘小学幼儿园新任教师79人笔试历年参考题库附带答案详解.docx
- [哈尔滨]2023年黑龙江哈尔滨市木兰县调配事业单位工作人员笔试历年参考题库附带答案详解.docx
- [上海]2023年上海市气象局所属事业单位招聘笔试历年参考题库附带答案详解.docx
- [台州]2023年浙江台州椒江区招聘中小学教师40人笔试历年参考题库附带答案详解.docx
最近下载
- 天然饮用水技改项目环评环境影响报告表(新版环评).doc
- DB13JT8469-2022人民防空工程标志设置标准.pdf
- 2024—2025学年甘肃省张掖市某校高一上学期期末联考模拟测试地理试卷.doc VIP
- 高大模板专项施工方案_图文.doc VIP
- 护林员知识培训课件.pptx
- 新教材苏教版数学二年级下册教案及教学反思全集(最全).doc
- 2024年新疆初中学业水平考试语文试卷试题真题(含答案详解).pdf
- GB50295-2016 水泥工厂设计规范.pdf
- 部编版语文六年级下册6骑鹅旅行记说课稿.doc
- 2024—2025学年甘肃省张掖市某校高一上学期期末联考模拟测试语文试卷.doc VIP
文档评论(0)