#include <bits/stdc++.h>
using namespace std;
int main()
{
double x1,y1,x2,y2,x3,y3,a,b,c,p,s;
freeopen("bai26.inp","r",stdin);
freeopen("bai26.out","w",stdout);
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
b=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
if (a+b>c && b+c>a && a+c>b)
{
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
cout<<fixed<<setprecision(2)<<s;
}
else cout<<"NONE";
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
bool isTriangle(pair<int, int> A, pair<int, int> B, pair<int, int> C) {
int x1 = A.first, y1 = A.second; int x2 = B.first, y2 = B.second; int x3 = C.first, y3 = C.second;
float area = 0.5 * abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));
return area != 0;
}
int main() {
pair<int, int> A = {1, 2};
pair<int, int> B = {4, 6};
pair<int, int> C = {5, 8};
if (isTriangle(A, B, C)) {
cout << "Ba diem A, B, C tao thanh mot tam giac." << endl; } else {
cout << "Ba diem A, B, C khong tao thanh mot tam giac." << endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
double x1,y1,x2,y2,x3,y3,a,b,c,p,s;
freeopen("bai26.inp","r",stdin);
freeopen("bai26.out","w",stdout);
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
b=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
c=sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
if (a+b>c && b+c>a && a+c>b)
{
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
cout<<fixed<<setprecision(2)<<s;
}
else cout<<"NONE";
return 0;
}