新手 不是很懂 只写了前两个
还不知道 对不对 还请多多指教
class count{
public:
count(string& a,string& b,string& c);
count(const count& var);
~count(){};
void setname(const string& m,const string& n);
void Toland();
private:
string usernumber;
string username;
string password;
}
count::count(string& a,string& b,string& c):usernumber(a),username(b),password(c){};
count::count(const count& var):usernumber(var.usernumber),username(var.username),password(var.password){};
void count::setname(const string& m,const string& n){
username=m;
password=n;
}
void count::TOland(){
int num=0;
string str,value;
do{
cout<<"输入用户名:";
getline(cin,str);
cout<<"输入用户口令:";
getline(cin,value);
if(username==str&&password==value)
cout<<"欢迎使用本系统";
else {
cout<<"输入的用户名或登陆口令错误";
++num;}
}while(num!=3)
}