Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 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 dreptunghi {punct st_s,dr_j;}drpt;
  9. cout<<"coordonate colt stanga sus - x: "; cin>>drpt.st_s.x;
  10. cout<<" - y: "; cin>>drpt.st_s.y;
  11. cout<<"coordonate colt dreapta jos - x: "; cin>>drpt.dr_j.x;
  12. cout<<" - y: "; cin>>drpt.dr_j.y;;
  13. cout<<"diagonala dreptunghiului este ";
  14. cout<<sqrt(pow(drpt.st_s.x-drpt.dr_j.x,2)+pow(drpt.st_s.y-drpt.dr_j.y,2));
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement