/*
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
Power operator+ (Power op2);
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
Power Power::operator+ (Power op2)
{
Power tmp;
tmp.kick = this->kick + op2.kick;
tmp.punch = this->punch + op2.punch;
return tmp;
}
int main()
{
Power a(3,5), b(4,6), c;
c= a + b;
a.show();
b.show();
c.show();
}
*/
/*
#include<iostream>
using namespace std;
class Rect;
class RectManager{
public:
bool equals(Rect r, Rect s);
void copy(Rect& dest, Rect& src);
};
class Rect{
int width, height;
public:
Rect(int width, int height)
{
this->width = width;
this->height == height;
}
friend RectManager;
};
bool RectManager::equals(Rect r, Rect s)
{
if(r.width==s.width&&r.height==s.height) return true;
else return false;
}
void RectManager::copy(Rect& dest, Rect& src)
{
dest.width = src.width, dest.height = src.height;
}
int main()
{
Rect a(3,4), b(5,6);
RectManager man;
man.copy(b,a);
if(man.equals(a,b)) cout << "equal" << endl;
else cout << "not equal" << endl;
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
bool operator==(Power op2);
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
bool Power::operator==(Power op2)
{
if(kick==op2.kick&&punch==op2.punch) return true;
else return false;
}
int main()
{
Power a(3,5), b(3,5);
a.show();
b.show();
if(a==b) cout << "equal" << endl;
else cout << "not equal" << endl;
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
Power& operator+=(Power op2);
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
Power& Power::operator+=(Power op2)
{
kick = kick + op2.kick;
punch = punch + op2.punch;
return *this;
}
int main()
{
Power a(3,5), b(4,6),c;
a.show();
b.show();
c = a+=b;
a.show();
c.show();
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
Power operator+(int op2);
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
Power Power::operator+(int op2)
{
Power tmp;
tmp.kick = kick + op2;
tmp.punch = punch + op2;
return tmp;
}
int main()
{
Power a(3,5), b;
a.show();
b.show();
b = a + 2;
a.show();
b.show();
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
Power& operator++();
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
Power& Power::operator++()
{
kick++;
punch++;
return *this;
}
int main()
{
Power a(3,4),b;
a.show();
b.show();
b = ++a;
a.show();
b.show();
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
bool operator!();
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
bool Power::operator!()
{
if(kick==0&&punch==0) return true;
else return false;
}
int main()
{
Power a(0,0), b(3,5);
a.show();
b.show();
if(!a) cout << "a의 파워가 0이다." << endl;
else cout << "a의 파워가 0이 아니다." << endl;
if(!b) cout << "b의 파워가 0이다." << endl;
else cout << "b의 파워가 0이 아니다." << endl;
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
Power operator++(int x);
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
Power Power::operator++(int x)
{
Power tmp=*this;
kick++;
punch++;
return tmp;
}
int main()
{
Power a(3,5),b;
a.show();
b.show();
b = a++;
a.show();
b.show();
}
*/
/*
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
friend Power operator+(int op1, Power op2);
};
void Power::show()
{
cout << "kick=" << kick << ',' << "punch=" << punch << endl;
}
Power operator+(int op1, Power op2)
{
Power tmp;
tmp.kick = op1+op2.kick;
tmp.punch = op1+op2.punch;
return tmp;
}
int main()
{
Power a(3,5),b;
a.show();
b.show();
b = 2 + a;
a.show();
b.show();
}
*/
#include<iostream>
using namespace std;
class Power{
int kick;
int punch;
public:
Power(int kick=0, int punch=0)
{
this->kick = kick;
this->punch = punch;
}
void show();
friend Power
};