/*
#include <iostream>
using namespace std;
class book
{
string t;
int price,pages;
public:
book(string t="",int price=0,int pages=0)
{
this->t=t;
this->price=price;
this->pages=pages;
}
void show()
{
cout << t<<' '<<price <<"원 "<<pages<<" 페이지" <<endl;
}
string gett()
{
return t;
}
bool operator==(int k);
bool operator==(string k);
bool operator==(book k);
};
bool book::operator==(int k)
{
if(this->price==k)
{
return true;
}
else
{
return false;
}
}
bool book::operator==(string k)
{
if(gett()==k)
{
return true;
}
else
{
return false;
}
}
bool book::operator==(book k)
{
if(gett()==k.t&&this->price==k.price&&this->pages==k.pages)
{
return true;
}
else
{
return false;
}
}
int main()
{
book a("명품",30000,500),b("고품",30000,500);
if (a==30000)
{
cout << "정가 30000원"<<endl;
}
if (a=="명품")
{
cout << "명픔" <<endl;
}
if (a==b)
{
cout << "같은책"<<endl;
}
}
*/
/*
#include <iostream>
using namespace std;
class book
{
string t;
int price,pages;
public:
book(string t="",int price=0,int pages=0)
{
this->t=t;
this->price=price;
this->pages=pages;
}
void show()
{
cout << t<<' '<<price <<"원 "<<pages<<" 페이지" <<endl;
}
string gett()
{
return t;
}
friend bool operator==(int k,book i);
friend bool operator==(string k,book i);
friend bool operator==(book k,book i);
};
bool operator==(int k,book i)
{
if(i.price==k)
{
return true;
}
else
{
return false;
}
}
bool operator==(string k,book i)
{
if(i.t==k)
{
return true;
}
else
{
return false;
}
}
bool operator==(book k,book i)
{
if(i.t==k.t&&i.price==k.price&&i.pages==k.pages)
{
return true;
}
else
{
return false;
}
}
int main()
{
book a("명품",30000,500),b("고품",30000,500);
if (30000==a)
{
cout << "정가 30000원"<<endl;
}
if ("명품"==a)
{
cout << "명픔" <<endl;
}
if (a==b)
{
cout << "같은책"<<endl;
}
}
*/
/*
#include <iostream>
using namespace std;
class book
{
string t;
int price,pages;
public:
book(string t="",int price=0,int pages=0)
{
this->t=t;
this->price=price;
this->pages=pages;
}
void show()
{
cout << t<<' '<<price <<"원 "<<pages<<" 페이지" <<endl;
}
string gett()
{
return t;
}
friend bool operator!(book i);
};
bool operator !(book i)
{
if (i.price==0)
{
return true;
}
else
{
return false;
}
}
int main()
{
book bok("벼룩시장",0,50);
if (!bok)
{
cout << "공짜"<<endl;
}
}
*/
#include <iostream>
using namespace std;
class book
{
string t;
int price,pages;
public:
book(string t="",int price=0,int pages=0)
{
this->t=t;
this->price=price;
this->pages=pages;
}
void show()
{
cout << t<<' '<<price <<"원 "<<pages<<" 페이지" <<endl;
}
string gett()
{
return t;
}
friend bool operator <()
};
int main()
{
book a("청춘",20000,300);
string b;
cout << "책 이름";
getline(cin,b);
if (b<a)
{
cout << a.gett()<<"이 "<<b<< "보다 뒤에 있구나!" <<endl;
}
}



