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 dreptunghi {punct st_s,dr_j;}drpt;
- cout<<"coordonate colt stanga sus - x: "; cin>>drpt.st_s.x;
- cout<<" - y: "; cin>>drpt.st_s.y;
- cout<<"coordonate colt dreapta jos - x: "; cin>>drpt.dr_j.x;
- cout<<" - y: "; cin>>drpt.dr_j.y;;
- cout<<"diagonala dreptunghiului este ";
- cout<<sqrt(pow(drpt.st_s.x-drpt.dr_j.x,2)+pow(drpt.st_s.y-drpt.dr_j.y,2));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement