?? c++實驗3.txt
字號:
#include <iostream.h>
#include <string.h>
class Password
{public:
Password()
{char stmp[]="PhiL_Cheng";
strcpy(str,stmp);}
int operator == (Password &str2);
void InputStr()
{cin>>str;}
private:
char str[256];
};
int Password::operator==(Password &s)
{if (!strcmp(str,s.str) ) return 1;
else return 0;
}
void main()
{Password p1,p2;
cout<<"Please Input Password:"<<endl;
p2.InputStr();
if (p1==p2) cout<<"You have got the right PassWord!"<<endl;
else cout<<"Your PassWord is wrong, -_-!"<<endl;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -