Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {struct punct {int x,y;};
- struct segment {punct pt1,pt2;};
- struct dreptunghi {segment lat,lung;};
- dreptunghi d; float 11,12;
- cout<<"Latimea - punct 1 - x = "; cin>>d.lat.pt1.x;
- cout<<" - y = "; cin>>d.lat.pt1.y;
- cout<<" - punct 2 - x = "; cin>>d.lat.pt2.x;
- cout<<" - y = "; cin>>d.lat.pt2.y;
- cout<<"Lungimea - punct 1 - x = "; cin>>d.lung.pt1.x;
- cout<<" - y = "; cin>>d.lung.pt1.y;
- cout<<" - punct 2 - x = "; cin>>d.lung.pt2.x;
- cout<<" - y = "; cin>>d.lung.pt2.y;
- 11= sqrt(pow(d.lat.pt1.x-d.lat.pt2.x,2)+pow(d.lat.pt1.y-d.lat.pt2.y,2))
- 12=sqrt(pow(d.lung.pt1.x-d.lung.pt2.x,2)+pow(d.lung.pt1.y-d.lung.pt2.y,2))
- cout<<sqrt(pow(11,2)+pow(12,2));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement