学生信息管理系统(0.00.03版)加油!!

#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;
struct x_x{
    string y_w;
    string x_xu;
    string y_y;
};
map<string,x_x>sts_2;
void add2_x_x(const string& name,string y_w,string x_xu,string y_y){
    if((sts_2[name].y_w.empty())==1&&(sts[name].age.empty())==0){
        sts_2[name]={y_w,x_xu,y_y};
        cout<<"已录入学生"<<name<<"的成绩。";
    }
    else if((sts_2[name].y_w.empty())==1&&(sts[name].age.empty())==1){
        cout<<"系统中没有该学生!";
    }
    else{
        cout<<"该学生已录入过成绩。";
    }
}
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())==0){
        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";
        if((sts_2[name].y_w.empty())==0){
            cout<<name<<"的语文成绩是:"<<sts_2[name].y_w<<"分。\n";
            cout<<name<<"的数学成绩是:"<<sts_2[name].x_xu<<"分。\n";
            cout<<name<<"的英语成绩是:"<<sts_2[name].y_y<<"分。\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.增加学生成绩 6.退出\n";
            cout<<"(因本作者能力有限,若本系统有bug请谅解,作者在此也表示诚挚的歉意)\n";
            cin>>opt;
            cout<<"\n";
            if(opt==1){
                system("cls");
                cout<<"请输入要增加的学生个数:";
                cin>>o;
                system("cls");
                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;
                system("cls");
                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;
                system("cls");
                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;
                system("cls");
                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==6){
                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 if(opt==5){
                system("cls");
                cout<<"请输入要增加成绩的学生个数:";
                cin>>o;
                system("cls");
                while(o--){
                    string ne,y_w,x_xu,y_y;
                    cout<<"请输入要增加成绩学生的姓名:";
                    cin>>ne;
                    cout<<"\n";
                    cout<<"输入要增加成绩学生的语文成绩:";
                    cin>>y_w;
                    cout<<"\n";
                    cout<<"输入要增加成绩学生的数学成绩:";
                    cin>>x_xu;
                    cout<<"\n";
                    cout<<"输入要增加成绩学生的英语成绩:";
                    cin>>y_y;
                    cout<<"\n";
                    add2_x_x(ne,y_w,x_xu,y_y);
                    Sleep(500);
                    system("cls");                                                            
                }
            }    
        }        
    }
    else{
        system("cls");
        cout_text("谢谢使用学生信息管理系统orz");
        exit(0);        
    }
    return 0;
}

  • 15
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值