运行效果图
- 启动界面
- 登录界面
- 超级管理员界面
程序介绍
- 系统采用文件操作方式,通过更改文件格式名保护系统及用户隐私。
- 提供三种登录模式,根据用户名和密码自动确认登录模式。
- 用户权限:
●高级管理员:修改用户信息、修改图书信息、添加图书、添加用户、删除图书、删除用户、全局浏览、查找用户或图书、调戏系统。
●普通管理员:全局浏览、查找用户或图书。
●读者:借还图书,修改自己信息,注销自己。
操
程序框架(H图)
程序框图
主函数
超级管理函数
显示函数
登录函数
读者函数
程序代码
打开文件函数
void open()
{
rename("BOOKSCCJ", "books.txt");
ifstream fcin;
fcin.open("books.txt", ios::in | ios::out);
int linnum = 1;
while (getline(fcin, line))
{
istringstream ss(line);
ss >> name >> num >> bian >>maker>> author;
NameMap.insert(pair<string, int>(name, num));
btemp.na = name;
btemp.nu = num;
btemp.bian = bian;
btemp.maker = maker;
btemp.author = author;
bookVector.push_back(btemp);
len++;
linnum++;
}
fcin.close();
rename( "books.txt","BOOKSCCJ");
rename("READERCCJ", "reader.txt");
ifstream mcin;
color(15);
mcin.open("reader.txt", ios::in | ios::out);
color(6);
while (getline(mcin, line))
{
istringstream ss(line);
ss >> rname >> bnum >> hist >> passwd >> books;
temp.na = rname;
temp.his = hist;
temp.nu = bnum;
temp.books = books;
temp.passwd = passwd;
readerVector.push_back(temp);
len++;
}
mcin.close();
rename( "reader.txt","READERCCJ");
}
显示函数
void display(int sele,int mb,int mr) {
color(3);
int tl,t2;
int linnum = 1;
if (mr == 0) {
if (mb == 0) {
cout << "╔═══════════════════════╦═══════════════════════╦═══════════════════════╦═══════════════════════╗" << endl;
for (auto kk = 0; kk != 50; kk++)
{
if (linnum % 4 != 0)
{
cout << "║" << left << setw(19) << bookVector[kk].na << "" << left << setw(2) << bookVector[kk].nu << "\t";
}
else
{
cout << "║" << left << setw(21) << bookVector[kk].na << "" << left << setw(2) << bookVector[kk].nu << "║" << endl;
cout << "╠═══════════════════════╬═══════════════════════╬═══════════════════════╬═══════════════════════╣" << endl;
}
len++;
linnum++;
}
while (linnum % 4 != 1) {
cout << "║" << left << setw(20) << "更多: " << " \t";
if (linnum % 4 == 0)
cout << "║" << left << setw(23) << " " << endl;
linnum++;
}
cout << "╚═══════════════════════╩═══════════════════════╩═══════════════════════╩═══════════════════════╝" << endl;
}
else {
cout << "╔═════════════════════╦═══════════════════╦═══════════════════╦═════════════════════╦═════════════════╗" << endl;
cout << "║" << left << setw(21) << "书名"<< "║" << left << setw(19) << "在馆数量" << "║" << left << setw(19) << "书籍编号" << "║" << left << setw(21) << "出版社" << "║" << left << setw(17) << "作者" << "║" << endl;
cout << "╠═════════════════════╬═══════════════════╬═══════════════════╬═════════════════════╬═════════════════╣" << endl;
for (auto kk = 0; kk != bookVector.size(); kk++)
{
cout << "║" << left << setw(21) << bookVector[kk].na << "║" << left << setw(19) << bookVector[kk].nu << "║" << left << setw(19) << bookVector[kk].bian << "║" << left << setw(21) << bookVector[kk].maker << "║" << left << setw(17) << bookVector[kk].author << "║" << endl;
cout << "╠═════════════════════╬═══════════════════╬═══════════════════╬═════════════════════╬═════════════════╣" << endl;
len++;
linnum++;
}
cout << "╚═════════════════════╩═══════════════════╩═══════════════════╩═════════════════════╩═════════════════╝" << endl;
}
}
color(6);
if (mb == 0) {
if (sele == 0) {
cout << left << setw(10) << "姓名" << left << setw(5) << "在借" << left << setw(5) << "共计" << left << setw(10) << "密码" << left << setw(40) << "在借列表" << endl;
}
if (mr == 0) t2 = 10;
else t2 = readerVector.size();
for (auto kk = 0; kk != t2; kk++)
{
if (sele == 0) {
cout << left << setw(10) << readerVector[kk].na << left << setw(5) << readerVector[kk].nu << left << setw(5) << readerVector[kk].his << left << setw(10) << readerVector[kk].passwd << left << setw(40) << readerVector[kk].books << endl;
}
}
}
}
普通管理员函数
void BOOKREADER::search()
{
display(0,0,0);
int flag = 1;
while(flag){
color(4);
cout << "【1.查找书名】 【 2.查找读者名】 【 0.退出】 " << endl;
cout << "【3.查看所有图书】 【 4.查看所有读者】 " << endl;
cin >> flag;
if (flag == 4) {
system("cls");
display(0, 0, 1);
color(4);
cout << "###################################################" << endl;
cout << "###################################################" << endl;
cout << "【 15.返回 】" << endl;
cout << "【 0.退出 】" << endl;
color(15);
cin >> flag;
if (flag == 15)
{
system("cls");
display(0, 0, 0);
}
}
if (flag == 3) {
system("cls");
display(0, 1, 0);
color(4);
cout << "###################################################" << endl;
cout << "###################################################" << endl;
cout << "【 15.返回 】" << endl;
cout << "【 0.退出 】" << endl;
color(15);
cin >> flag;
if (flag == 15)
{
system("cls");
display(0, 0, 0);
}
}
if(flag==2)
{
color(15);
cout << "你要找谁?" << endl;
cin >> srname;
vector <Point2>::iterator iElement = find(readerVector.begin(), readerVector.end(), srname);
if (iElement != readerVector.end())
{
int nPosition = distance(readerVector.begin(), iElement);
cout << " find in the vector at position: " << nPosition + 1 << endl;
cout << srname << "共借了;" << readerVector[nPosition].his << "本 在借;" << readerVector[nPosition].nu << "本,分别是:" << readerVector[nPosition].books << endl;
}
else cout << "抱歉,查无此人" << endl;
}
if (flag == 1)
{
color(15);
cout << "你要找什么书?" << endl;
cin >> sname;
if (NameMap.count(sname) > 0) {
vector <Point1>::iterator bElement = find(bookVector.begin(), bookVector.end(), sname);
if (bElement != bookVector.end())
{
int bPosition = distance(bookVector.begin(), bElement);
cout << " find in the vector at position: " << bPosition + 1 << endl;
cout << "书名;" << bookVector[bPosition].na << " 在馆;" << bookVector[bPosition].nu << "本, 编号:" << bookVector[bPosition].bian << " 作者:" << bookVector[bPosition].author << endl;
}
}
else cout << "抱歉,我们暂时没有这本书哦" << endl;
}
}
}
高级管理员函数
void BOOKREADER::edit() {
display(0,0,0);
int flag = 10;
while(flag!=0){
color(4);
cout << "##########################################################################" << endl;
cout << "########################### 请开始你的操作 ##########################" << endl;
cout << "##########################################################################" << endl;
cout << "【 1.查找书名 】 【 2.查找读者名 】 【 3.删除图书 】" << endl;
cout << "【 4.删除读者 】 【 5.修改读者信息 】 【 6.修改图书信息 】" << endl;
cout << "【 7.添加图书 】 【 8.添加读者 】 【 9.我就看看,不进去 】" << endl;
cout << "【 10.显示更多图书 】 【 11.显示更多读者 】 【 0.退出 】 " << endl;
cin >> flag;
if (flag == 11) {
system("cls");
display(0, 0, 1);
color(4);
cout << "###################################################" << endl;
cout << "###################################################" << endl;
cout << "【 15.返回 】" << endl;
cout << "【 0.退出 】" << endl;
color(15);
cin >> flag;
if (flag == 15)
{
system("cls");
display(0, 0, 0);
}
}
if (flag == 10) {
system("cls");
display(0, 1, 0);
color(4);
cout << "###################################################" << endl;
cout << "###################################################" << endl;
cout << "【 15.返回 】" << endl;
cout << "【 0.退出 】" << endl;
color(15);
cin >> flag;
if (flag == 15)
{
system("cls");
display(0, 0, 0);
}
}
if (flag == 2)
{
color(15);
cout << "你要找谁?" << endl;
cin >> srname;
vector <Point2>::iterator iElement = find(readerVector.begin(),readerVector.end(), srname);
if (iElement != readerVector.end())
{
int nPosition = distance(readerVector.begin(), iElement);
cout << " find in the vector at position: " << nPosition + 1 << endl;
cout << srname << "共借了;"<< readerVector[nPosition].his << "本 在借;" << readerVector[nPosition] .nu<< "本,分别是:"<< readerVector[nPosition].books<< endl;
}
}
if (flag == 1)
{
color(15);
cout << "你要找什么书?" << endl;
cin >> sname;
if (NameMap.count(sname) > 0) {
vector <Point1>::iterator bElement = find(bookVector.begin(),bookVector.end(), sname);
if (bElement != bookVector.end())
{
int bPosition = distance(bookVector.begin(), bElement);
cout << " find in the vector at position: " << bPosition + 1 << endl;
cout << "书名;" << bookVector[bPosition].na << " 在馆;" << bookVector[bPosition].nu << "本, 编号:" << bookVector[bPosition].bian<< " 作者:" << bookVector[bPosition].author << endl;
}
}
else cout <<"抱歉,我们暂时没有这本书哦" << endl;
}
if (flag == 3)
{
color(15);
cout << "你要删除什么书?" << endl;
cin >> sname;
vector <Point1>::iterator bElement = find(bookVector.begin(), bookVector.end(), sname);
if (bElement != bookVector.end())
{
int bPosition = distance(bookVector.begin(), bElement);
cout << " find in the vector at position: " << bPosition + 1 << endl;
bookVector.erase(bElement);
}
cout << "已删除" << endl;
}
if (flag == 4)
{
color(15);
cout << "你要删除谁?" << endl;
cin >> srname;
vector <Point2>::iterator iElement = find(readerVector.begin(), readerVector.end(), srname);
if (iElement != readerVector.end())
{
int nPosition = distance(readerVector.begin(), iElement);
cout << " find in the vector at position: " << nPosition + 1 << endl;
readerVector.erase(iElement);
}
cout << "已删除" << endl;
}
if (flag == 5)
{
color(15);
cout << "你要修改谁的信息?" << endl;
cin >> srname;
vector <Point2>::iterator iElement = find(readerVector.begin(), readerVector.end(), srname);
if (iElement != readerVector.end())
{
int nPosition = distance(readerVector.begin(), iElement);
cout << " find in the vector at position: " << nPosition + 1 << endl;
cout << srname << "共借了;" << readerVector[nPosition].his << "本 在借;" << readerVector[nPosition].nu << "本,分别是:" << readerVector[nPosition].books << endl;
}
cout << "你要修那一项?" << endl;
color(4);
cout << "【 1.姓名 】 【 2.借书现量 】 【 3.借书名称 】 【 4.用户密码 】" << endl;
color(15);
cin >> what;
if (what == 4)
{
cout << "你要修改为多少?" << endl;
cin >> newpass;
int nPosition = distance(readerVector.begin(), iElement);
readerVector[nPosition].passwd = newpass;
}
if(what==2)
{
cout << "你要修改为多少?" << endl;
cin >> newr;
int nPosition = distance(readerVector.begin(), iElement);
readerVector[nPosition].nu=newr;
}
if (what == 1)
{
cout << "你要修改为多少?" << endl;
cin >> newn;
int nPosition = distance(readerVector.begin(), iElement);
readerVector[nPosition].na = newn;
}
if (what == 3)
{
cout << "你要修改为多少?" << endl;
cin >> newn;
int nPosition = distance(readerVector.begin(), iElement);
readerVector[nPosition].books = readerVector[nPosition].books+newn;
readerVector[nPosition].nu = readerVector[nPosition].nu + 1;
readerVector[nPosition].his = readerVector[nPosition].his + 1;
}
cout << "已修改" << endl;
}
if (flag == 6)
{
color(15);
cout << "你要修改什么书的信息?" << endl;
cin >> sname;
vector <Point1>::iterator bElement = find(bookVector.begin(), bookVector.end(), sname);
if (NameMap.count(sname) > 0) {
if (bElement != bookVector.end())
{
int bPosition = distance(bookVector.begin(), bElement);
cout << " find in the vector at position: " << bPosition + 1 << endl;
cout << "书名;" << bookVector[bPosition].na << " 在馆;" << bookVector[bPosition].nu << "本, 编号:" << bookVector[bPosition].bian << " 作者:" << bookVector[bPosition].author << endl;
}
what = 1;
while (what) {
cout << "你要修那一项?" << endl;
color(4);
cout << "【 1.书名 】 【 2.库存现量 】 【 3.编号 】 【 4.作者 】【 0.退出并保存修改 】" << endl;
color(15);
cin >> what;
if (what == 4)
{
cout << "你要修改为多少?" << endl;
cin >> newau;
int bPosition = distance(bookVector.begin(), bElement);
bookVector[bPosition].author = newau;
}
if (what == 2)
{
cout << "你要修改为多少?" << endl;
cin >> newbnu;
int bPosition = distance(bookVector.begin(), bElement);
bookVector[bPosition].nu = newbnu;
}
if (what == 1)
{
cout << "你要修改为多少?" << endl;
cin >> newbna;
int bPosition = distance(bookVector.begin(), bElement);
bookVector[bPosition].na = newbna;
}
if (what == 3)
{
cout << "你要修改为多少?" << endl;
cin >> newbbian;
int bPosition = distance(bookVector.begin(), bElement);
bookVector[bPosition].bian = newbbian;
}
}
}
else cout << "抱歉,我们暂时没有这本书哦" << endl;
}
if (flag == 7)
{
int keep = 1;
color(15);
while(keep){
cout << "请输入书名:" << endl;
cin >> name;
vector <Point1>::iterator bElement = find(bookVector.begin(), bookVector.end(), name);
if (bElement != bookVector.end())
{
cout << "书籍已存在,请重新出入" << endl;
}
else {
cout << "请输入数目" << endl;
cin >> num;
cout << "请输入编号:" << endl;
cin >> bian;
cout << "请输入作者" << endl;
cin >> author;
cout << "请输入出版商" << endl;
cin >> maker;
btemp.na = name;
btemp.nu = num;
btemp.bian = bian;
btemp.author = author;
btemp.maker = maker;
bookVector.push_back(btemp);
cout << "已添加" << endl;
keep = 0;
}
}
}
if (flag == 8)
{
color(15);
cout << "请输入读者姓名:" << endl;
cin >> rname;
cout << "请输入初始密码" << endl;
cin >> bnum;
temp.na = rname;
temp.passwd = bnum;
temp.nu = 0;
temp.his = 0;
temp.books = "无";
readerVector.push_back(temp);
cout << "已添加" << endl;
}
if (flag == 9){
system("cls");
color(4);
for (int ti = 0; ti < 4; ti++)
{
cout << endl;
}
cout << " 你好坏坏~~~~~。~~~~~" << endl;}
for (int ti = 0; ti < 4; ti++)
{
cout << endl;
}
}
rename("BOOKSCCJ", "books.txt");
ofstream fcout;
fcout.open("books.txt");
color(10);
cout << "\n写入文件books.txt··············" << endl;
for (auto kk = 0; kk != bookVector.size(); kk++)
{
fcout << bookVector[kk].na << " " << bookVector[kk].nu << " " << bookVector[kk].bian << " " << bookVector[kk].maker<<" " << bookVector[kk].author << endl;
}
fcout.close();
rename("books.txt","BOOKSCCJ");
ofstream bcout;
rename("READERCCj", "reader.txt");
bcout.open("reader.txt");
color(10);
cout << "\n写入文件reader.txt··············" << endl;
for (auto kk = 0; kk != readerVector.size(); kk++)
{
bcout << readerVector[kk].na << " " << readerVector[kk].nu << " " << readerVector[kk].his << " " << readerVector[kk].passwd << " " << readerVector[kk].books << endl;
}
bcout.close();
rename("reader.txt", "READERCCJ");
}
登录函数
int login() {
system("color F0");
rename("USERCCJ","user.txt");
int b, c = 0, pass[8], i = 0, p;
ifstream fcin;
fcin.open("user.txt", ios::in | ios::out);
string line, name, rname, books;
int len = 0, num, bnum, flag = 10, m = 1, hist,passwd;
map<string, int> NameMap;
while (getline(fcin, line))
{
istringstream ss(line);
ss >> name >> num;
NameMap.insert(pair<string, int>(name, num));
len++;
}
fcin.close();
rename("user.txt","USERCCJ" );
ifstream mcin;
rename("READERCCJ", "reader.txt");
mcin.open("reader.txt", ios::in | ios::out);
cout << endl;
vector<Point2>readerVector2;
Point2 temp2;
while (getline(mcin, line))
{
istringstream ss(line);
ss >> rname >> bnum >> hist >> passwd >> books;
temp2.na = rname;
temp2.his = hist;
temp2.nu = bnum;
temp2.passwd = passwd;
temp2.books = books;
readerVector2.push_back(temp2);
len++;
}
mcin.close();
rename("reader.txt", "READERCCJ");
cout << endl;
if (swich == 1) {
for (int ti = 0; ti < 8; ti++)
{
cout << endl;
}
cout << " 正在启动" << endl;
cout << endl;
cout << endl;
cout << " " << " ";
for (int n = 0; n < 50; n++) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 1 | 0 | 128);
cout << " " << "";
Sleep(50);
}
for (int ti = 0; ti < 8; ti++)
{
cout << endl;
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 16 | 128 | 112);
cout << " <- 系统初始化完成 ->" << endl;
Sleep(1000);
system("cls");
swich++;
system("color F0");
}
system("cls");
for (int ti = 0; ti < 8; ti++)
{
cout << endl;
}
cout << " ═════════════════════════════════════════════════════════════" << endl;
cout << " 欢迎使用庆国淡泊书局系统 " << endl;
cout << " ═════════════════════════════════════════════════════════════" << endl;
cout << endl;
cout << " 请输入用户名:" << " ";
cin >> a;
cout << endl;
cout << " 请输入密码:" << " ";
c = 0;
for (i = 0; i < 8; i++)
{
b = _getch();
if (b >= '0' && b <= '9')
{
pass[i] = b;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 15 | 0 | 0);
cout << "*";
m = b - 48;
for (int t = 0; t < 7 - i; t++) {
m = m * 10;
}
c = c + m;
}
}
cout << endl;
if (NameMap.count(a) > 0)
{
auto itb = NameMap.find(a);
system("color F0");
if (itb->second == c) {
for (int ti = 0; ti < 4; ti++)
{
cout << endl;
}
cout << " " << " ";
for (int n = 0; n < 4; n++) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 16 | 128 | 112);
cout << "●" << "";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 15 | 127 | 128);
cout << " " << "";
Sleep(500);
}
return 1;
}
else return 0;
}
else {
vector <Point2>::iterator iElement = find(readerVector2.begin(), readerVector2.end(), a);
if (iElement != readerVector2.end())
{
int nPosition = distance(readerVector2.begin(), iElement);
system("color F0");
if (readerVector2[nPosition].passwd== c) {
for (int ti = 0; ti < 4; ti++)
{
cout << endl;
}
cout << " " << " ";
for (int n = 0; n < 3; n++) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 16 | 128 | 112);
cout << "●" << "";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 15 | 127 | 128);
cout << " " << "";
Sleep(500);
}
return 1;
}
else return 0;
}
}
}
读者借阅函数
void borrow(string username)
{
display(1,0,0);
vector <Point2>::iterator iElement = find(readerVector.begin(), readerVector.end(), username);
if (iElement != readerVector.end())
{
int nPosition = distance(readerVector.begin(), iElement);
cout << " find in the vector at position: " << nPosition + 1 << endl;
cout << username << "共借了;" << readerVector[nPosition].his << "本 在借;" << readerVector[nPosition].nu << "本,分别是:" << readerVector[nPosition].books << endl;
}
int state = 1;
while(state)
{
cout << "本店《红楼》新上架章节,快来看看吧!" << endl;
cout << "你要选择那一项?" << endl;
color(4);
cout << "【 1.借书 】 【 2.归还 】 【 3.注销账户 】 【 4.更改密码 】【 0.退出 】" << endl;
color(15);
cin >> state;
if (state == 1)
{
string bookname;
cout << "请输入书名(回车确定):" << endl;
cin >> bookname;
if (NameMap.count(bookname) > 0) {
vector <Point1>::iterator bElement = find(bookVector.begin(), bookVector.end(), bookname);
if (NameMap.count(bookname) > 0) {
if (bElement != bookVector.end())
{
int bPosition = distance(bookVector.begin(), bElement);
bookVector[bPosition].nu = bookVector[bPosition].nu - 1;
}
}
int nPosition = distance(readerVector.begin(), iElement);
readerVector[nPosition].nu = readerVector[nPosition].nu + 1;
readerVector[nPosition].his = readerVector[nPosition].his + 1;
if (readerVector[nPosition].nu == 1)
clean_str(&readerVector[nPosition].books, "无");
readerVector[nPosition].books = readerVector[nPosition].books + bookname;
}
else cout << "抱歉,我们暂时没有这本书哦" << endl;
}
if (state == 2)
{
string bookname;
cout << "请输入书名(回车确定):" << endl;
cin >> bookname;
vector <Point1>::iterator bElement = find(bookVector.begin(), bookVector.end(), bookname);
if (NameMap.count(bookname) > 0) {
if (bElement != bookVector.end())
{
int bPosition = distance(bookVector.begin(), bElement);
bookVector[bPosition].nu = bookVector[bPosition].nu + 1;
}
}
int nPosition = distance(readerVector.begin(), iElement);
readerVector[nPosition].nu = readerVector[nPosition].nu-1;
clean_str(&readerVector[nPosition].books,bookname);
cout << "处理后:" << readerVector[nPosition].books;
if (readerVector[nPosition].nu == 0)
readerVector[nPosition].books= "无";
}
if (state == 3)
{
int sure = 1;
while (sure)
{
cout << "确认注销?该操作无法撤销!:" << endl;
cout << "【1.我已确认】 【2.你再挽留一下,看看我心情好不好】 【0.算了算了】" << endl;
cin >> sure;
if(sure==1){
readerVector.erase(iElement);
state = 0;
sure = 0;
cout << "期待再见!:" << endl;
}
if (sure == 2) {
cout << "再您妈的见!告辞!" << endl;
cout << "哈哈哈哈,开个玩笑,亲爱的在考虑下哟:" << endl;
}
}
}
if (state == 4)
{
int passn;
cout << "请输入密码:" << endl;
cin >> passn;
int nPosition = distance(readerVector.begin(), iElement);
readerVector[nPosition].passwd =passn;
}
}
rename("BOOKSCCJ", "books.txt");
ofstream fcout;
fcout.open("books.txt");
color(10);
cout << "\n写入文件books.txt··············" << endl;
for (auto kk = 0; kk != bookVector.size(); kk++)
{
fcout << bookVector[kk].na << " " << bookVector[kk].nu << " " << bookVector[kk].bian << " " << bookVector[kk].maker << " " << bookVector[kk].author << endl;
}
fcout.close();
rename("books.txt", "BOOKSCCJ");
ofstream bcout;
rename("READERCCj", "reader.txt");
bcout.open("reader.txt");
color(10);
cout << "\n写入文件reader.txt··············" << endl;
for (auto kk = 0; kk != readerVector.size(); kk++)
{
bcout << readerVector[kk].na << " " << readerVector[kk].nu << " " << readerVector[kk].his << " " << readerVector[kk].passwd << " " << readerVector[kk].books << endl;
}
bcout.close();
rename("reader.txt", "READERCCJ");
}
主函数
int main()
{
int b=4;
open();
while (1) {
b=login();
if (b == 1) {
if (a == "范思辙")
{
system("color 0F");
system("cls");
color(15);
for (int ti = 0; ti < 8; ti++)
{
cout << endl;
}
cout << endl;
cout << " 欢迎~ 亲爱的!" << a<<endl;
Sleep(1000);
system("cls");
BOOKREADER sadmin;
ADMIN admin;
admin.ADMINin(sadmin);
}
else if(a=="大学士甲"|| a=="大学士乙"|| a=="大学士丙")
{
system("color 0F");
system("cls");
color(15);
for (int ti = 0; ti < 8; ti++)
{
cout << endl;
}
cout << endl;
cout << " 欢迎~ 亲爱的" <<a<< endl;
Sleep(1000);
system("cls");
BOOKREADER sadmin;
sadmin.search();
}
else
{
system("color 0F");
system("cls");
color(15);
for (int ti = 0; ti < 8; ti++)
{
cout << endl;
}
cout << endl;
cout << " 寂寞宫廷春欲晚,与君相约醉《红楼》!" << endl;
cout << endl;
Sleep(1500);
cout << " 欢迎~ 亲爱的!" << a << endl;
Sleep(800);
system("cls");
cout << endl;
borrow(a);
}
}
else
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0 | 16 | 128 | 112);
for (int ti = 0; ti < 4; ti++)
{
cout << endl;
}
cout << " 用户名或密码错误" << " ";
cout << " 请重试!" << " ";
}
Sleep(1000);
}
}
程序工程源文件下载