#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
void cout_text(string s){
for(int i=0;i<s.size();i++){
cout<<s[i];
Sleep(50);
}
}
struct Student{
string age;
string gender;
};
map<string,Student>sts;
void add_st(const string& name,string age,string gender){
if((sts[name].age.empty())==1){
sts[name]={age,gender};
cout<<"已录入学生"<<name<<"。";
}
else{
cout<<"该学生已被录入过!";
}
}
void erase_st(const string& name){
if((sts[name].age.empty())==1){
sts.erase(name);
cout<<"已删除"<<name<<"。";
}
else{
cout<<"没有"<<name<<"这个同学。\n";
}
}
void cx_st(const string& name){
if((sts[name].age.empty())==0){
cout<<name<<"是"<<sts[name].age<<"岁,是一个"<<sts[name].gender<<"生\n\n";
}
else{
cout<<"没有"<<name<<"这个同学。\n";
}
}
void ce_st(const string& name,string age){
if((sts[name].age.empty())==1){
sts[name].age=age;
}
else{
cout<<"没有"<<name<<"这个同学。\n";
cout<<"所以无法更改!";
}
}
int o;
void print_begin(){
srand(time(NULL));
string beginmap[20]={
{"▉ "},
{"▉▉ "},
{"▉▉▉ "},
{"▉▉▉▉ "},
{"▉▉▉▉▉ "},
{"▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ "},
{"▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉"}
};
for(int i=0;i<20;i++){
system("cls");
cout<<" ___ ___ ___ ___ | "<<"\n";
cout<<" \\ /\\ /|__ | | | | |\/| |__ | "<<"\n";
cout<<" \\/ \\/ |___ |__ |___ |___| | | |___ . "<<"\n\n";
cout<<"\n\n 名称:学生信息管理系统!!!\n\n ";
cout<<" -----------------------------------------\n"<<" | "<<beginmap[i]<<" |\n -----------------------------------------\n\n";
cout<<" 作者:至尊枪神 ";
Sleep(rand()%500);
}
Sleep(500);
system("cls");
}
signed main(){
system("color F1");
system("mode con cols=70 lines=20");
mt19937 Rand(time(0));
print_begin();
int opt=0;
cout_text("本系统的免责说明:\n");
cout_text("1.本系统不会有任何保密责任(包括但不限于姓名,年龄,性别)\n");
cout_text("2.若未阅读以上说明导致信息泄露本作者无任何责任!\n");
int u;
cout<<"同意并已阅读本系统的免责说明 选择 1\n";
cout<<"不同意并退出 选择 2\n";
cin>>u;
system("cls");
if(u==1){
cout_text("欢迎使用学生信息管理系统!\n");
while(1){
cout<<"请输入要使用的功能:\n";
cout<<"1.新增学生 2.删除学生 3.查找学生 4.更改学生 5.退出\n";
cout<<"(因本作者能力有限,若本系统有bug请谅解,作者在此也表示诚挚的歉意)\n";
cin>>opt;
cout<<"\n";
if(opt==1){
system("cls");
cout<<"请输入要增加的学生个数:";
cin>>o;
cout<<"\n";
while(o--){
string ne,gr,ae;
cout<<"请输入要新增的学生姓名:";
cin>>ne;
cout<<"\n";
cout<<"请输入要新增的学生年龄:";
cin>>ae;
cout<<"\n";
cout<<"请输入要新增的学生性别:";
cin>>gr;
cout<<"\n";
add_st(ne,ae,gr);
Sleep(300);
system("cls");
}
}
else if(opt==2){
system("cls");
cout<<"请输入要删除的学生个数:";
cin>>o;
cout<<"\n";
while(o--){
string ne;
cout<<"请输入要删除的学生姓名:";
cin>>ne;
cout<<"\n";
erase_st(ne);
Sleep(500);
system("cls");
}
}
else if(opt==3){
system("cls");
cout<<"请输入要查找的学生个数:";
cin>>o;
cout<<"\n";
while(o--){
string ne;
cout<<"请输入要查找的学生姓名:";
cin>>ne;
cout<<"\n";
cx_st(ne);
Sleep(2000);
system("cls");
}
}
else if(opt==4){
system("cls");
cout<<"请输入要的更改学生个数:";
cin>>o;
cout<<"\n";
while(o--){
string ne,gr,ae;
cout<<"请输入要更改的学生姓名:";
cin>>ne;
cout<<"\n";
cout<<"请输入要更改的学生年龄:";
cin>>ae;
cout<<"\n";
ce_st(ne,ae);
Sleep(2000);
system("cls");
}
}
else if(opt==5){
system("cls");
cout<<"确定退出么?\n";
cout<<"1.确定;2.我再想想\n";
cin>>opt;
if(opt==1){
system("cls");
cout_text("谢谢使用学生信息管理系统orz");
exit(0);
}
else{
system("cls");
cout<<"欢迎回来!!";
system("color E1");
Sleep(10);
system("color A1");
Sleep(10);
system("color B1");
Sleep(10);
system("color 21");
Sleep(10);
system("color 51");
Sleep(10);
system("color 01");
Sleep(10);
system("color 31");
Sleep(10);
system("color 21");
Sleep(10);
system("color F1");
system("cls");
continue;
}
}
}
}
else{
system("cls");
cout_text("谢谢使用学生信息管理系统orz");
exit(0);
}
return 0;
}