You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# include "question.h"
# include "hanshu.h"
# include <iostream>
# include <memory>
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 ;
}