string usrname="duoduo"; //待匹配的用户名
string password=“mypassword”; //带匹配的密码
bool checkUserPass(string usrname,string mypassword){
string SucUsrname=“duoduo”;
string SucPassword="mypassword";
if(usrname.equal(SucUsrname)&&mypassword.equal(SucPassword)){
getAccess();
}else{
noAccess();
}
}
void getAccess(){
cout>>"Accessed Successfully">>"\n";
}
void noAccess(){
cout>>"Access denied">>"\n";
}
希望能够帮到你!