DidiMilikina

Untitled

Sep 20th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.     double x1, y1, x2, y2;
  7.     cin >> x1 >> y1 >> x2 >> y2;
  8.  
  9.     double area = abs(x2 - x1) * abs(y1 - y2);
  10.     double peremeter = 2 * (abs(x2 - x1) + abs(y1 - y2));
  11.     cout << area << endl;
  12.     cout << peremeter << endl;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment