Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- class otrezok{
- int x1,x2,y1,y2;
- public:
- otrezok() {x1 = 0; x2 = 0; y1 = 0; y2 = 0;}
- otrezok(int a, int b, int c, int d) {x1 = a; y1 = b; x2 = c; y2 = d;}
- float dlina() {return sqrt(pow((x1-x2),2)+pow((y1-y2),2));}
- };
- otrezok maximum(otrezok a, otrezok b, otrezok c)
- {
- otrezok max;
- return max;
- }
- int main()
- {
- int a,b,c,d;
- otrezok ob1(0,0,1,1);
- otrezok ob2(0,0,3,3);
- otrezok ob3(0,0,5,5);
- cout << ob1.dlina() << endl << ob2.dlina() << endl << ob3.dlina();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement