Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main() {
  6. int x1,y1,x2,y2,dl,sh,S,P;
  7. cout <<"Vvedite pervie koordinati" << endl;
  8. cin >> x1;
  9. cin >> y1;
  10. cout << "Vvedite vtorie koordinati" << endl;
  11. cin >> x2;
  12. cin >> y2;
  13.  
  14.  
  15. if (x1 > x2) dl = x1 - x2;
  16. else dl = x2 - x1;
  17. if (y1 > y2) sh = y1 - y2;
  18. else sh = y2 - y1;
  19.  
  20. S = sh * dl;
  21. P = (sh + dl) * 2;
  22. cout << "Ploshad ="<< S << endl << "Perimetr="<< P;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement