#include <iostream>
#include <math.h>
using namespace std;
main()
{
double x1, x2, x3, y1, y2, y3, L1, L2, L3, S;
cout << endl << "1X" << endl;
cin >> x1;
cout << endl << "1Y" << endl;
cin >> y1;
cout << endl << "2X" << endl;
cin >> x2;
cout << endl << "2Y" << endl;
cin >> y2;
cout << endl<< "3X" << endl;
cin >> x3;
cout << endl << "3Y" << endl;
cin >> y3;
L1 = sqrt (( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ));
L2 = sqrt (( x3 - x2 ) * ( x3 - x2 ) + ( y3 - y2 ) * ( y3 - y2 ));
L3 = sqrt (( x1 - x3 ) * ( x1 - x3 ) + ( y1 - y3 ) * ( y1 - y3 ));
S = sqrt ((L1 + L2 + L3)/2 * ((L1 + L2 + L3)/2 - L1) * ((L1 + L2 + L3)/2 - L1) * ((L1 + L2 + L3)/2) - L3);
cout << " Ploshad treugolnika " << S << endl;
} |