Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <iomanip>
- using namespace std;
- int main()
- {
- double x1, y1, x2, y2;
- cin >> x1 >> y1 >> x2 >> y2;
- double area = abs(x2 - x1) * abs(y1 - y2);
- double perimeter = 2 * (abs(x2 - x1) + abs(y1 - y2));
- cout << fixed << setprecision(4) << area << endl;
- cout << perimeter << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment