#include
#include
using namespace std;
class Point
{
private: int x,y; //Координаты точки
public: Point() { cout << "Input x and y for point: "<> x >> y;}
int GetX() {return x;}
int GetY() {return y;}
void operator!() {if((y==0) && (x==0))cout << "centre"<<endl;
else cout << "no centre"<<endl;
}
void operator-() {if((y>0) && (x>0))cout << "1"<<endl;
else if((y0)) cout << "2"<<endl;
else if((y<0) && (x<0)) cout << "3"<<endl;
else if((y0)) cout << "4"<<endl;
}
void operator>(int k) {if( k==1 && x>0 && y>0) cout << "point 1"<<endl;
if( k==2 && x>0 && y<0) cout << "point 2"<<endl;
if( k==3 && x<0 && y<0) cout << "point 3"<<endl;
if( k==4 && x0) cout << "point 4"<<endl;
else cout<< "ne tam"<<endl; }
~Point (){}
};
int main()
{Point a;
int x1,y1;
x1=a.GetX(); y1=a.GetY();
cout<< x1<<" "<< y1 <<endl;
//!a;
a.operator!();
a.operator-();
int k1; cin>>k1;
a.operator>(k1);
}
доработать operator> в классе
| Гарантия на работу | 1 год |
| Средний балл | 4.52 |
| Стоимость | Назначаете сами |
| Эксперт | Выбираете сами |
| Уникальность работы | от 70% |