Advertisement
Pafnytiu

функции

Nov 17th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. float Func1(float x1, float x2, float y1, float y2)
  5. {float d=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
  6. return d;}
  7. float Func2(float a, float b, float c)
  8. {float p=a+b+c;
  9. return p;}
  10. int main()
  11. {float x1,x2, x3, y1,y2,y3;
  12. float a,b,c,p;
  13. cin>>x1>>x2>>x3>>y1>>y2>>y3;
  14. a=Func1(x1,x2,y1,y2);
  15. b=Func1(x1,x3,y1,y3);
  16. c=Func1(x3,x2,y3,y2);
  17. p=Func2(a,b,c);
  18. cout<<"perimetr="<<p<<endl;
  19. system("pause");
  20. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement