📄 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;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -