1 Star 1 Fork 0

huizhuoli/summer_study

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.cpp 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
huizhuoli 提交于 2022-06-26 11:09 . 修改对象
#include <iostream>
#include "Student.h"
#include "GlobalData.h"
int main() {
while(true){
cout<<"请选择登录类型"<<endl;
cout<<"1.教师"<<endl;
cout<<"2.学生"<<endl;
cout<<"3.退出"<<endl;
int loginType;
cin >> loginType;
if (loginType == 3)
break;
if (loginType == 2){
cout<<"请输入学号"<<endl;
string stuNo;
cin>>stuNo;
cout<<"请输入密码"<<endl;
string stuPsw;
cin>>stuPsw;
CStudent* student = GlobalData::userManager.StudentLogin(stuNo, stuPsw);
if (student == NULL)
break;
student->DoFunction();
}
if (loginType == 1){
cout<<"请输入教师账号ID"<<endl;
int teacherId;
cin>>teacherId;
cout<<"请输入密码"<<endl;
string teacherPsw;
cin>>teacherPsw;
CTeacher* teacher = GlobalData::userManager.TeacherLogin(teacherId, teacherPsw);
if (teacher == NULL){
cout<<"密码错误"<<endl;
break;
}
teacher->DoFunction();
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huizhuoli/summer_study.git
git@gitee.com:huizhuoli/summer_study.git
huizhuoli
summer_study
summer_study
master

搜索帮助