Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- float Func1(float x1, float x2, float y1, float y2)
- {float d=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
- return d;}
- float Func2(float a, float b, float c)
- {float p=a+b+c;
- return p;}
- int main()
- {float x1,x2, x3, y1,y2,y3;
- float a,b,c,p;
- cin>>x1>>x2>>x3>>y1>>y2>>y3;
- a=Func1(x1,x2,y1,y2);
- b=Func1(x1,x3,y1,y3);
- c=Func1(x3,x2,y3,y2);
- p=Func2(a,b,c);
- cout<<"perimetr="<<p<<endl;
- system("pause");
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement