Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
631 B
0
Indexable
Never
#include <fstream>
#include <iostream>
#include <string>
using namespace std;	
int aa(int x1, int x2) {
	return x2 - x1;
}
int bb(int y1, int y2) {
	return y1 - y2;
}
int PP(int a, int b) {
	return 2 * a + 2 * b;
}
int SS(int a, int b) {
	return a * b;
}
float CTx(float a, float x) {
	return float(x + (a/2)) ;
}
float CTy(float b, float y) {
	return float(y - (b / 2));
}
int main()
{
	float a, b, x[4], y[4];
	for (int i = 0; i < 4; i++)
	{
		cin >> x[i] >> y[i];
	}
	a = aa(x[0], x[1]);
	b = bb(y[1], y[2]);
	cout << SS(a, b) << endl << PP(a, b) << endl << CTx(a, x[0]) << " " << CTy(b, y[0]);
}