Advertisement
mercMatvey4

Untitled

Apr 27th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. class otrezok{
  6. int x1,x2,y1,y2;
  7. public:
  8. otrezok() {x1 = 0; x2 = 0; y1 = 0; y2 = 0;}
  9. otrezok(int a, int b, int c, int d) {x1 = a; y1 = b; x2 = c; y2 = d;}
  10. float dlina() {return sqrt(pow((x1-x2),2)+pow((y1-y2),2));}
  11. };
  12.  
  13. otrezok maximum(otrezok a, otrezok b, otrezok c)
  14. {
  15. otrezok max;
  16. return max;
  17. }
  18.  
  19. int main()
  20. {
  21. int a,b,c,d;
  22. otrezok ob1(0,0,1,1);
  23. otrezok ob2(0,0,3,3);
  24. otrezok ob3(0,0,5,5);
  25. cout << ob1.dlina() << endl << ob2.dlina() << endl << ob3.dlina();
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement