#include "question.h" #include "hanshu.h" #include #include using namespace std; int main() { while(1){ string exit; DisplayWelcomeMessage(); // 登录循环 User* currentuser = nullptr; while (!currentuser) { cout << "请输入用户名和密码(用空格隔开,输入exit结束程序):"; string username, password; cin >> username ; if(username=="exit"){ exit = username; break; } cin>>password; currentuser = AuthenticateUser(username, password); if (!currentuser) { cout << "请输入正确的用户名、密码" << endl; } } if(exit == "exit"){ cout << "程序已结束,感谢使用!"; break; } // 创建题目生成器 auto generator = CreateQuestionGenerator(currentuser->usertype); DisplayCurrentMode(currentuser->usertype); DisplayQuestionGenerator(std::move(generator),currentuser); } return 0; }