#include<iostream>
using namespace std;
class Person {
public:
string name;
int age;
Person(string n, int a)
{
name = n;
age = a;
}
bool operator==(Person& p) {
if (name == p.name && age == p.age) {
return true;
}
return false;
}
bool operator!=(Person& pp) {
if (name == pp.name && age == pp.age) {
return true;
}
return false;
}
};
void test01()
{
Person p1("huanggang",18);
Person p2("huanggang",18);
Person p3("huanggang", 11);
Person p4("huanggang", 18);
if (p1 == p2) {
cout << "相等" << endl;
}
else {
cout << "不相等" << endl;
}
if (p3 == p4) {
cout << "相等" << endl;
}
else {
cout << "不相等" << endl;
}
}
int main()
{
test01();
return 0;
}