Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include<bits/stdc++.h>
#include<complex>
#define eps 1e-9
using namespace std;
typedef complex<double> point;
typedef pair<point, point> line;
//b??????a??????????????????
double dis(point a, point b){
  return abs(a - b);
}

//??????
double dot(point a, point b){
  return a.real()*b.real() + a.imag()*b.imag();
}

//??????
double cross(point a, point b){
  return imag(conj(a) * b);
}

//counter clock wise
int ccw(point a, point b, point c){
  if(cross(b - a, c - a) >  eps)return  1;//??????ab????????´
  if(cross(b - a, c - a) < -eps)return -1;//??????ab????????´
  if(dot(b - a, c - a) < -eps)return 2;//??´???ab??????a???????????????
  if(abs(b - a) + eps < abs(c - a))return -2;//??´???ab??????b???????????????
  return 0;//??´???ab???
}

double line_to_point_dis(line l, point p){
  return abs(cross(p - l.first, l.second - l.first))/
    abs(l.second - l.first);
}

double seg_to_point_dis(line l, point p){
  point a = l.first, b = l.second, c = p;
  if(dot(b - a, c - a) < eps)return abs(c - a);
  if(dot(a - b, c - b) < eps)return abs(c - b);
  return line_to_point_dis(l, p);
}

double seg_to_seg_dis(line a, line b){
  double res = seg_to_point_dis(a, b.first);
  res = min(res, seg_to_point_dis(a, b.second));
  res = min(res, seg_to_point_dis(b, a.first));
  res = min(res, seg_to_point_dis(b, a.second));
  return res;
}

bool is_cross(line a, line b){
  if(ccw(a.first, a.second, b.first) *
     ccw(a.first, a.second, b.second) <= 0 &&
     ccw(b.first, b.second, a.first) *
     ccw(b.first, b.second, a.second) <= 0){
    return true;
  }
  return false;
}

point cross_point(line a, line b){
  double d1 = cross(b.second - b.first,
                    b.first - a.first);
  double d2 = cross(b.second - b.first,
                    a.second - a.first);
  return a.first + (a.second - a.first) * d1/d2;
}

pair<point, point> norm(point p){
  return pair<point, point>(p*point(0, 1),
                            p*point(0, -1));
}

int main(int argc, char *argv[]){
  point x[3], p;
  double real[3], imag[3], r, i;
  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &real[0], &imag[0],
              &real[1], &imag[1], &real[2], &imag[2], &r, &i) != EOF){
    for (int i = 0; i < 3; i++) {
      x[i] = complex<double>(real[i], imag[i]);
    }
    p = complex<double>(r, i);
    line l[3];
    for (int i = 0; i < 3; i++) {
      l[i].first = x[i];
      l[i].second = x[(i + 1)%3];
    }
    int a[3];
    for (int i = 0; i < 3; i++) {
      a[i] = ccw(x[i], x[(i + 1)%3], p);
    }
    if(a[0] == a[1] && a[1] == a[2] && a[0] == a[2])std::cout << "YES" << std::endl;
    else std::cout << "NO" << std::endl;
  }
  return 0;
}

C++: #include <iostream>

bool is_same_side(double x1, double x2, double y1, double y2, double px1, double py1, double px2, double py2)
{
        return ((px1 - x1)*(py1 - y2)-(px1 - x2)*(py1 - y1))*((px2 - x1)*(py2 - y2)-(px2 - x2)*(py2 - y1)) > 0;
}

int main()
{
        double x1, x2, x3, y1, y2, y3, xp, yp;
        while(std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
                if(     is_same_side(x1, x2, y1, y2, x3, y3, xp, yp) &&
                        is_same_side(x2, x3, y2, y3, x1, y1, xp, yp) &&
                        is_same_side(x3, x1, y3, y1, x2, y2, xp, yp))
                        std::cout << "YES" << std::endl;
                else
                        std::cout << "NO" << std::endl;
        return 0;
}

C++: #include<stdio.h>
int main(){
	double x1,x2,x3,y1,y2,y3,xo,yo;
    double a,b,c;
 
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xo,&yo)!=EOF){
        a = (x2-x1)*(yo-y1)-(y2-y1)*(xo-x1);
        b = (x3-x2)*(yo-y2)-(y3-y2)*(xo-x2);
        c = (x1-x3)*(yo-y3)-(y1-y3)*(xo-x3);
        if((a>0&&b>0&&c>0) || (a<0&&b<0&&c<0)){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}

C++: 

    double x1, y1, x2, y2, x3, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        pair<double, double> a, b, p;
        a.first = x2 - x1;
        a.second = y2 - y1;
        b.first = x3 - x1;
        b.second = y3 - y1;
        p.first = xp - x1;
        p.second = yp - y1;
        double theta = angle(a, b);
        double phi = angle(a, p);
        double psi = angle(b, p);
        
        if (norm(p) > norm(a) || norm(p) > norm(b)) {
            anslist.push_back("NO");
            break;
        }
        if (phi > theta || psi > theta) {
            anslist.push_back("NO");
            break;
        }
        anslist.push_back("YES");
    }

    for(auto ans : anslist) {
        cout << ans << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
double helon(double x1,double y1,double x2,double y2,double x3,double y3){
	double a,b,c,s,area;
	a = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	b = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
	c = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
	s = (a+b+c)/2;
	area = sqrt(s*(s-a)*(s-b)*(s-c));
	return area;
}

int main(){
	double e=0.000000000001;
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		double s,s1,s2,s3;
		s = helon(x1,y1,x2,y2,x3,y3);
		s1 = helon(xp,yp,x1,y1,x2,y2);
		s2 = helon(xp,yp,x2,y2,x3,y3);
		s3 = helon(xp,yp,x3,y3,x1,y1);
		cout<<s<<" "<<s1<<" "<<s2<<" "<<s3<<endl;
		if(s1==0 || s2==0 || s3==0)
			cout<<"NO"<<endl;
		else if(fabs(s-(s1+s2+s3))<e)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
		
	}
	return 0;
}