Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {struct punct {int x,y;};
  8. struct segment {punct pt1,pt2;};
  9. struct dreptunghi {segment lat,lung;};
  10. dreptunghi d; float 11,12;
  11. cout<<"Latimea - punct 1 - x = "; cin>>d.lat.pt1.x;
  12. cout<<" - y = "; cin>>d.lat.pt1.y;
  13. cout<<" - punct 2 - x = "; cin>>d.lat.pt2.x;
  14. cout<<" - y = "; cin>>d.lat.pt2.y;
  15. cout<<"Lungimea - punct 1 - x = "; cin>>d.lung.pt1.x;
  16. cout<<" - y = "; cin>>d.lung.pt1.y;
  17. cout<<" - punct 2 - x = "; cin>>d.lung.pt2.x;
  18. cout<<" - y = "; cin>>d.lung.pt2.y;
  19. 11= sqrt(pow(d.lat.pt1.x-d.lat.pt2.x,2)+pow(d.lat.pt1.y-d.lat.pt2.y,2))
  20.  
  21. 12=sqrt(pow(d.lung.pt1.x-d.lung.pt2.x,2)+pow(d.lung.pt1.y-d.lung.pt2.y,2))
  22. cout<<sqrt(pow(11,2)+pow(12,2));
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement