Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
641 B
0
Indexable
Never
#include <iostream>
#include <fstream>
using namespace std;

float CTx;
float CTy;

// Задача 3
float s(float a, float b)
{
    return a * b;
}
float p(float a, float b)
{
    return 2 * (a + b);
}
void CT(float a, float b, float x1, float y1)
{
    CTx = x1 + (a / 2);
    CTy = y1 - (b / 2);
}

int main()
{
    // Задача 3
    ifstream in("input.txt");
    float x1, x2, x3, x4, y1, y2, y3, y4, a, b;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

    a = x2 - x1;
    b = y1 - y3;

    CT(a, b, x1, y1);

    cout << s(a, b) << endl << p(a, b) << endl << CTx << ' ' << CTy;
}