fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. void meanings(double x1,double x2,double y1,double y2,double &angle,double &distance){
  5. double dx=x2-x1;
  6. double dy=y2-y1;
  7. distance=sqrt(dx*dx+dy*dy);
  8. angle=atan(dy/dx);
  9. }
  10. void elsemeanings(double length, double width, double &area, double &perimetr){
  11. area=length*width;
  12. perimetr=2*(length+width);
  13. }
  14.  
  15. int main() {
  16. cout<<"---here---\n";
  17. double x1=0, y1=0, x2=3, y2=4;
  18. double dist, ang;
  19. meanings(x1,x2,y1,y2,ang,dist);
  20. cout<<"angle:"<<ang<<"\n";
  21. cout<<"distance;"<<dist<<"\n";
  22.  
  23. double l=5,w=10;
  24. double a,p;
  25. elsemeanings(l,w,a,p);
  26.  
  27. cout<<"area"<<a<<"\n";
  28. cout<<"perimetr"<<p<<"\n";
  29. return 0;
  30. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
---here---
angle:0.927295
distance;5
area50
perimetr30