news 2026/2/14 0:36:56

CBMS最新源码

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CBMS最新源码

今天再次上传一下我最近新开发的代码。

#include <bits/stdc++.h> using namespace std; char x; int book_count = 0, jieyue_count = 0; struct Books { char program[3]; string name; int in_school_year; char where_fangwei, where_xingzhuang, where_build, where_book_count[4]; int where_lie, where_hang, where_floor, many = 0; int out_book = 0; } a[9999999]; struct Jieyue { char program[11][3]; string book_name[11]; int in_school_year[11]; char where_fangwei[11], where_xingzhuang[11], where_build[11], where_book_count[11][4]; int where_lie[11], where_hang[11], where_floor[11]; string name; int book_number = 0; } people[500500]; inline void plus_book() { printf("请输入您要添加的书籍数量:\n"); int plus = 0; cin >> plus; for(; plus --; ) { printf("请输入书籍信息(例如:LS 2022J 3NZ 5 4 001 西安故事 2):\n"); ++book_count; cin >> a[book_count].program[1] >> a[book_count].program[2] >> a[book_count].in_school_year >> a[book_count].where_build >> a[book_count].where_floor >> a[book_count].where_fangwei >> a[book_count].where_xingzhuang >> a[book_count].where_hang >> a[book_count].where_lie >> a[book_count].where_book_count[1] >> a[book_count].where_book_count[2] >> a[book_count].where_book_count[3]; scanf(" "); cin >> a[book_count].name >> a[book_count].many; printf("输入信息成功\n这本书在:"); if(a[book_count].where_build == 'J') { cout << "旧楼"; }else { cout << "新楼"; } cout << a[book_count].where_floor << "层"; if(a[book_count].where_fangwei == 'N') { cout << "北区"; } else if(a[book_count].where_fangwei == 'S') { cout << "南区"; } else if(a[book_count].where_fangwei == 'W') { cout << "西区"; } else if(a[book_count].where_fangwei == 'E') { cout << "东区"; } else { cout << "中区"; } if(a[book_count].where_xingzhuang == 'Z') { cout << "直型书柜"; } else { cout << "环形书柜"; } cout << a[book_count].where_hang << "行" << a[book_count].where_hang << "列 第" << a[book_count].where_book_count[1] << a[book_count].where_book_count[2] << a[book_count].where_book_count[3] << "本书"; cout << " 这本书一共有" << a[book_count].many << "本\n"; } return; } inline void find_book() { printf("请输入查找书籍名称:\n"); string find_name; scanf("\n"); cin >> find_name; bool can_find = false; for (int i = 1; i <= book_count; i++) { if (a[i].name == find_name) { if(a[i].where_build == 'J') { cout << "旧楼"; }else { cout << "新楼"; } cout << a[i].where_floor << "层"; if(a[i].where_fangwei == 'N') { cout << "北区"; } else if(a[i].where_fangwei == 'S') { cout << "南区"; } else if(a[i].where_fangwei == 'W') { cout << "西区"; } else if(a[i].where_fangwei == 'E') { cout << "东区"; } else { cout << "中区"; } if(a[i].where_xingzhuang == 'Z') { cout << "直型书柜"; } else { cout << "环形书柜"; } cout << a[i].where_hang << "行" << a[i].where_hang << "列 第" << a[i].where_book_count[1] << a[i].where_book_count[2] << a[i].where_book_count[3] << "本书"; cout << " 这本书目前一共有" << a[i].many << "本\n"; can_find = true; } } if (!can_find) { cout << "对不起,目前暂无您要查找的书籍。\n"; } return; } inline void take_out() { printf("请输入您的名字(禁止重复):\n"); string name; cin >> name; int name_num = 0; bool has_take_out = false; for(int i = 1; i <= jieyue_count; i ++) { if(people[i].name == name) { has_take_out = true; name_num = i; break; } } if(!has_take_out) { printf("正在为您办理借阅开。\n"); jieyue_count++; people[jieyue_count].name = name; printf("借阅开已为您办理好了,欢迎您借阅图书!\n"); } printf("\n请输入借阅本数:\n"); int book_much = 0; cin >> book_much; printf("\n请依次输入您要借阅的书籍名称:\n"); for (int i = 1; i <= book_much; i++) { string find_name; scanf("\n"); cin >> find_name; bool can_find = false; for (int j = 1; j <= book_count; j++) { if (a[j].name == find_name && (a[j].out_book <= a[j].many && a[j].many >= 0)) { if(!has_take_out) { people[jieyue_count].book_number++; cout << a[j].program[1] << a[j].program[2] << a[j].in_school_year << a[j].where_build << a[j].where_floor << a[j].where_fangwei << a[j].where_xingzhuang << a[j].where_hang << a[j].where_lie << a[j].where_book_count[1] << a[j].where_book_count[2] << a[j].where_book_count[3] << a[j].name << "\n"; people[jieyue_count].program[people[jieyue_count].book_number][1] = a[j].program[1]; people[jieyue_count].program[people[jieyue_count].book_number][2] = a[j].program[2]; people[jieyue_count].in_school_year[people[jieyue_count].book_number] = a[j].in_school_year; people[jieyue_count].where_build[people[jieyue_count].book_number] = a[j].where_build; people[jieyue_count].where_fangwei[people[jieyue_count].book_number] = a[j].where_fangwei; people[jieyue_count].where_xingzhuang[people[jieyue_count].book_number] = a[j].where_xingzhuang; people[jieyue_count].where_book_count[people[jieyue_count].book_number][1] = a[j].where_book_count[1]; people[jieyue_count].where_book_count[people[jieyue_count].book_number][2] = a[j].where_book_count[2]; people[jieyue_count].where_book_count[people[jieyue_count].book_number][3] = a[j].where_book_count[3]; people[jieyue_count].where_floor[people[jieyue_count].book_number] = a[j].where_floor; people[jieyue_count].where_lie[people[jieyue_count].book_number] = a[j].where_lie; people[jieyue_count].where_hang[people[jieyue_count].book_number] = a[j].where_hang; } else { people[name_num].book_number++; cout << a[j].program[1] << a[j].program[2] << a[j].in_school_year << a[j].where_build << a[j].where_floor << a[j].where_fangwei << a[j].where_xingzhuang << a[j].where_hang << a[j].where_lie << a[j].where_book_count[1] << a[j].where_book_count[2] << a[j].where_book_count[3] << a[j].name << "\n"; people[name_num].program[people[name_num].book_number][1] = a[j].program[1]; people[name_num].program[people[name_num].book_number][2] = a[j].program[2]; people[name_num].in_school_year[people[name_num].book_number] = a[j].in_school_year; people[name_num].where_build[people[name_num].book_number] = a[j].where_build; people[name_num].where_fangwei[people[name_num].book_number] = a[j].where_fangwei; people[name_num].where_xingzhuang[people[name_num].book_number] = a[j].where_xingzhuang; people[name_num].where_book_count[people[name_num].book_number][1] = a[j].where_book_count[1]; people[name_num].where_book_count[people[name_num].book_number][2] = a[j].where_book_count[2]; people[name_num].where_book_count[people[name_num].book_number][3] = a[j].where_book_count[3]; people[name_num].where_floor[people[name_num].book_number] = a[j].where_floor; people[name_num].where_lie[people[name_num].book_number] = a[j].where_lie; people[name_num].where_hang[people[name_num].book_number] = a[j].where_hang; } can_find = true; a[j].out_book++; a[j].many--; break; } } if (!can_find) { cout << "对不起,您要借阅的书籍暂无。\n"; } else if (people[jieyue_count].book_number == 10) { cout << "您的借阅最大书籍数限制已到。\n"; } else { cout << "您要借阅的书籍已经被设为“借阅”模式!\n"; cout << "如果您还没有拿到这本书,请去:"; if(a[i].where_build == 'J') { cout << "旧楼"; }else { cout << "新楼"; } cout << a[i].where_floor << "层"; if(a[i].where_fangwei == 'N') { cout << "北区"; } else if(a[i].where_fangwei == 'S') { cout << "南区"; } else if(a[i].where_fangwei == 'W') { cout << "西区"; } else if(a[i].where_fangwei == 'E') { cout << "东区"; } else { cout << "中区"; } if(a[i].where_xingzhuang == 'Z') { cout << "直型书柜"; } else { cout << "环形书柜"; } cout << a[i].where_hang << "行" << a[i].where_hang << "列 第" << a[i].where_book_count[1] << a[i].where_book_count[2] << a[i].where_book_count[3] << "本书"; cout << "拿取,感谢您的配合。\n"; } } return; } inline void turn_back(){ printf("请输入您的名字:\n"); string name; cin >> name; int name_num = 0; bool has_take_out = false; for(int i = 1; i <= jieyue_count; i ++) { if(people[i].name == name) { has_take_out = true; name_num = i; break; } } if(!has_take_out) { printf("抱歉,您没有借阅图书!\n"); return; } printf("\n请输入还回本数:\n"); int book_much = 0; cin >> book_much; printf("\n请依次输入您要还回的书籍名称:\n"); for (int i = 1; i <= book_much; i++) { string find_name; scanf("\n"); cin >> find_name; bool can_find = false; int where = 0; for (int j = 1; j <= book_count; j++) { if (a[j].name == find_name && (a[j].out_book >= 1)) { people[name_num].book_number--; where = j; cout << a[j].program[1] << a[j].program[2] << a[j].in_school_year << a[j].where_build << a[j].where_floor << a[j].where_fangwei << a[j].where_xingzhuang << a[j].where_hang << a[j].where_lie << a[j].where_book_count[1] << a[j].where_book_count[2] << a[j].where_book_count[3] << a[j].name << "\n"; people[name_num].program[people[name_num].book_number][1] = 0; people[name_num].program[people[name_num].book_number][2] = 0; people[name_num].in_school_year[people[name_num].book_number] = 0; people[name_num].where_build[people[name_num].book_number] = 0; people[name_num].where_fangwei[people[name_num].book_number] = 0; people[name_num].where_xingzhuang[people[name_num].book_number] = 0; people[name_num].where_book_count[people[name_num].book_number][1] = 0; people[name_num].where_book_count[people[name_num].book_number][2] = 0; people[name_num].where_book_count[people[name_num].book_number][3] = 0; people[name_num].where_floor[people[name_num].book_number] = 0; people[name_num].where_lie[people[name_num].book_number] = 0; people[name_num].where_hang[people[name_num].book_number] = 0; can_find = true; a[j].out_book--; a[j].many++; break; } } if (!can_find) { cout << "对不起,您似乎没有借阅这本书。\n"; } else if(has_take_out){ cout << "您要还回的书籍已经被设为“馆藏”模式!\n"; cout << "如果您还没有归还这本书,请去:"; if(a[where].where_build == 'J') { cout << "旧楼"; }else { cout << "新楼"; } cout << a[where].where_floor << "层"; if(a[where].where_fangwei == 'N') { cout << "北区"; } else if(a[where].where_fangwei == 'S') { cout << "南区"; } else if(a[where].where_fangwei == 'W') { cout << "西区"; } else if(a[where].where_fangwei == 'E') { cout << "东区"; } else { cout << "中区"; } if(a[where].where_xingzhuang == 'Z') { cout << "直型书柜"; } else { cout << "环形书柜"; } cout << a[where].where_hang << "行" << a[where].where_hang << "列 第" << a[where].where_book_count[1] << a[where].where_book_count[2] << a[where].where_book_count[3]<< "本书"; cout << "归还,感谢您的配合。\n"; if(people[name_num].book_number == 0) { cout << "您目前已还回所有书籍,欢迎您再来!\n"; } } else { cout << "您要还回的书籍已经被设为“馆藏”模式!\n"; cout << "如果您还没有归还这本书,请去:"; if(a[where].where_build == 'J') { cout << "旧楼"; }else { cout << "新楼"; } cout << a[where].where_floor << "层"; if(a[where].where_fangwei == 'N') { cout << "北区"; } else if(a[where].where_fangwei == 'S') { cout << "南区"; } else if(a[where].where_fangwei == 'W') { cout << "西区"; } else if(a[where].where_fangwei == 'E') { cout << "东区"; } else { cout << "中区"; } if(a[where].where_xingzhuang == 'Z') { cout << "直型书柜"; } else { cout << "环形书柜"; } cout << a[where].where_hang << "行" << a[where].where_hang << "列 第" << a[where].where_book_count[1] << a[where].where_book_count[2] << a[where].where_book_count[3]<< "本书"; cout << "归还,感谢您的配合。\n"; } } return; } inline void delete_book() { printf("请输入要删除的书籍信息(例如:LS 2022J 3NZ 5 4 001 西安故事):\n"); char program[3]; string name; int in_school_year; char where_fangwei, where_xingzhuang, where_build, where_book_count[4]; int where_lie, where_hang, where_floor; cin >> program[1] >> program[2] >> in_school_year >> where_build >> where_floor >> where_fangwei >> where_xingzhuang >> where_hang >> where_lie; scanf(" "); cin >> where_book_count[1] >> where_book_count[2] >> where_book_count[3]; scanf(" "); cin >> name; bool find_delete = false; int where_delete = 0; for(int i = 1; i <= book_count; i ++) { if(a[i].program[1] == program[1] && a[i].program[2] == program[2] && a[i].in_school_year == in_school_year && a[i].where_build == where_build && a[i].where_floor == where_floor && a[i].where_fangwei == where_fangwei && a[i].where_lie == where_lie && a[i].where_hang == where_hang && a[i].where_xingzhuang == where_xingzhuang && a[i].name == name) { find_delete = true; where_delete = i; break; } } if(find_delete) { printf("您确定要删除位于"); if(a[find_delete].where_build == 'J') { cout << "旧楼"; }else { cout << "新楼"; } cout << a[find_delete].where_floor << "层"; if(a[find_delete].where_fangwei == 'N') { cout << "北区"; } else if(a[find_delete].where_fangwei == 'S') { cout << "南区"; } else if(a[find_delete].where_fangwei == 'W') { cout << "西区"; } else if(a[find_delete].where_fangwei == 'E') { cout << "东区"; } else { cout << "中区"; } if(a[find_delete].where_xingzhuang == 'Z') { cout << "直型书柜"; } else { cout << "环形书柜"; } cout << a[find_delete].where_hang << "行" << a[find_delete].where_hang << "列 第" << a[find_delete].where_book_count[1] << a[find_delete].where_book_count[2] << a[find_delete].where_book_count[3] << "本书"; cout << "的这本书籍吗?(输入1(删除)或0(不删除))\n"; int YN = 0; cin >> YN; if(YN == 1) { for(int i = where_delete + 1; i <= book_count; i ++) { a[i - 1] = a[i]; } book_count --; printf("已删除!\n"); } else { printf("已取消删除操作!\n"); } } else { printf("抱歉,暂无您要删除的书籍。\n"); } return; } inline void hello_window(){ printf("\t\t 欢迎来到XXXX图书管理系统 \t\t\n"); printf("\t Welcome to XXXX Books Management System\t\t\n"); printf("\t\t XXX 监制 XXXX制作组 制作\t\t\n"); printf("\t Version/版本:XXXX \t\t\n"); printf("\t\t Tips:请勿乱操作“删除图书”功能,否则将会进行惩罚。 \t\t\n"); printf("\t\t XXX制作组成员:XXX"); printf("\n"); printf("\t\t\t 录入图书请按1 \t\t\n"); printf("\t\t\t 查找图书请按2 \t\t\n"); printf("\t\t\t 借阅图书请按3 \t\t\n"); printf("\t\t\t 还回图书请按4 \t\t\n"); printf("\t\t\t 删除图书请按5 \t\t\n"); printf("\t\t\t *_* 欢迎使用 \t\t\n"); printf("\n"); cin >> x; if (x == '1') { plus_book(); } else if (x == '2') { find_book(); } else if (x == '3') { take_out(); } else if (x == '4') { turn_back(); } else if (x == '5') { delete_book(); } hello_window(); } int main(){ hello_window(); }

若使用了我代码的部分,请提前向我说明,感谢各位的支持

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/2/11 20:38:41

LangFlow代码折叠功能实用性评测

LangFlow代码折叠功能实用性评测 在构建AI应用的战场上&#xff0c;效率与清晰度往往是决定成败的关键。随着大语言模型&#xff08;LLM&#xff09;逐渐成为智能系统的核心引擎&#xff0c;开发者面临的问题不再是“能不能做”&#xff0c;而是“如何快速、可靠、可维护地做出…

作者头像 李华
网站建设 2026/2/11 20:38:39

LRCGET终极指南:快速构建离线音乐歌词库的完整解决方案

LRCGET终极指南&#xff1a;快速构建离线音乐歌词库的完整解决方案 【免费下载链接】lrcget Utility for mass-downloading LRC synced lyrics for your offline music library. 项目地址: https://gitcode.com/gh_mirrors/lr/lrcget 在数字化音乐时代&#xff0c;离线音…

作者头像 李华
网站建设 2026/2/11 20:38:37

在线法线贴图生成神器:零代码打造专业级3D纹理效果

在线法线贴图生成神器&#xff1a;零代码打造专业级3D纹理效果 【免费下载链接】NormalMap-Online NormalMap Generator Online 项目地址: https://gitcode.com/gh_mirrors/no/NormalMap-Online 想要让平面图像瞬间拥有立体质感吗&#xff1f;现在只需一个浏览器&#x…

作者头像 李华
网站建设 2026/2/11 20:38:34

Windows 11 LTSC一键恢复Microsoft Store:3分钟搞定应用商店安装

Windows 11 LTSC一键恢复Microsoft Store&#xff1a;3分钟搞定应用商店安装 【免费下载链接】LTSC-Add-MicrosoftStore Add Windows Store to Windows 11 24H2 LTSC 项目地址: https://gitcode.com/gh_mirrors/ltscad/LTSC-Add-MicrosoftStore 还在为Windows 11 LTSC系…

作者头像 李华
网站建设 2026/2/11 14:26:00

如何用LRCGET在60秒内为你的本地音乐库批量获取同步歌词

如何用LRCGET在60秒内为你的本地音乐库批量获取同步歌词 【免费下载链接】lrcget Utility for mass-downloading LRC synced lyrics for your offline music library. 项目地址: https://gitcode.com/gh_mirrors/lr/lrcget 你是否收藏了上千首本地音乐&#xff0c;却因为…

作者头像 李华
网站建设 2026/2/11 20:38:31

PvZ Toolkit终极指南:植物大战僵尸修改器的完整使用教程

PvZ Toolkit终极指南&#xff1a;植物大战僵尸修改器的完整使用教程 【免费下载链接】pvztoolkit 植物大战僵尸 PC 版综合修改器 项目地址: https://gitcode.com/gh_mirrors/pv/pvztoolkit PvZ Toolkit是一款专为《植物大战僵尸》PC版设计的强大辅助工具&#xff0c;它通…

作者头像 李华