Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Header.h"
- using namespace std;
- class Koord
- {
- private:
- int x1;
- int y1;
- int x2;
- int y2;
- int x3;
- int y3;
- int x4;
- int y4;
- int perimetr;
- public:
- void set(){
- cout << "vvedite koord 4eh tochek: " << endl;
- cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
- }
- int perim(){
- perimetr = 2 * (x4 - x1) + 2 * y2;
- return perimetr;
- }
- int otbr1(){
- if ((x1 < 0) || (x4 < 0) || (y1 != 0) || (y4 != 0) || (y2 != y3) || (x2 != x1) || (x3 != x4))cout << "error"<< endl;
- else {
- x1 = -1 * x1;
- x2 = -1 * x2;
- x3 = -1 * x3;
- x4 = -1 * x4;
- cout << "ot1: " << x1 << " "<< y1 << endl << x2 <<" "<< y2 << endl << x3 <<" "<< y3 << endl << x4 << " " << y4;
- cout << endl;
- }
- return 0;
- }
- int otbr2(){
- // if ((x1 < 0) || (x4 < 0) || (y1 != 0) || (y4 != 0) || (y2 != y3) || (x2 != x1) || (x3 != x4))cout << "error"<< endl;
- // else {
- y2 = -1 * y2;
- y3 = -1 * y3;
- cout << "ot2: " << x1 << " " << y1 << endl << x2 << " "<< y2 << endl << x3 << " "<< y3 << endl << x4 << " "<< y4;
- cout << endl;
- return 0;
- }
- int otbr3(){
- // if ((x1 < 0) || (x4 < 0) || (y1 != 0) || (y4 != 0) || (y2 != y3) || (x2 != x1) || (x3 != x4))cout << "error"<< endl;
- //else {
- x1 = -1 * x1;
- x2 = -1 * x2;
- x3 = -1 * x3;
- x4 = -1 * x4;
- cout << "ot3: " << x1<< " " << y1 << endl << x2 << " "<< y2 << endl << x3 << " "<< y3 << endl << x4 << " "<< y4;
- cout << endl;
- return 0;
- }
- void show(){
- cout << "perimetr raven: "<< perim() << endl << endl;
- cout << otbr1() << endl;
- cout << otbr2() << endl;
- cout << otbr3() << endl;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement