Advertisement
mashlukashova

Untitled

Apr 12th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #include "Header.h"
  2. using namespace std;
  3. class Koord
  4. {
  5. private:
  6. int x1;
  7. int y1;
  8. int x2;
  9. int y2;
  10. int x3;
  11. int y3;
  12. int x4;
  13. int y4;
  14. int perimetr;
  15. public:
  16. void set(){
  17. cout << "vvedite koord 4eh tochek: " << endl;
  18. cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
  19. }
  20. int perim(){
  21. perimetr = 2 * (x4 - x1) + 2 * y2;
  22. return perimetr;
  23. }
  24. int otbr1(){
  25. if ((x1 < 0) || (x4 < 0) || (y1 != 0) || (y4 != 0) || (y2 != y3) || (x2 != x1) || (x3 != x4))cout << "error"<< endl;
  26. else {
  27. x1 = -1 * x1;
  28. x2 = -1 * x2;
  29. x3 = -1 * x3;
  30. x4 = -1 * x4;
  31. cout << "ot1: " << x1 << " "<< y1 << endl << x2 <<" "<< y2 << endl << x3 <<" "<< y3 << endl << x4 << " " << y4;
  32. cout << endl;
  33. }
  34. return 0;
  35. }
  36.  
  37.  
  38. int otbr2(){
  39. // if ((x1 < 0) || (x4 < 0) || (y1 != 0) || (y4 != 0) || (y2 != y3) || (x2 != x1) || (x3 != x4))cout << "error"<< endl;
  40. // else {
  41. y2 = -1 * y2;
  42. y3 = -1 * y3;
  43. cout << "ot2: " << x1 << " " << y1 << endl << x2 << " "<< y2 << endl << x3 << " "<< y3 << endl << x4 << " "<< y4;
  44. cout << endl;
  45.  
  46. return 0;
  47. }
  48.  
  49. int otbr3(){
  50. // if ((x1 < 0) || (x4 < 0) || (y1 != 0) || (y4 != 0) || (y2 != y3) || (x2 != x1) || (x3 != x4))cout << "error"<< endl;
  51. //else {
  52.  
  53. x1 = -1 * x1;
  54. x2 = -1 * x2;
  55. x3 = -1 * x3;
  56. x4 = -1 * x4;
  57.  
  58. cout << "ot3: " << x1<< " " << y1 << endl << x2 << " "<< y2 << endl << x3 << " "<< y3 << endl << x4 << " "<< y4;
  59. cout << endl;
  60.  
  61. return 0;
  62. }
  63.  
  64. void show(){
  65. cout << "perimetr raven: "<< perim() << endl << endl;
  66. cout << otbr1() << endl;
  67. cout << otbr2() << endl;
  68. cout << otbr3() << endl;
  69.  
  70. }
  71.  
  72. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement