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 <stdio.h>

int main(void)
{
	float x[3], y[3], xp, yp;
	float sM, s1, s2, s3;
	
	while (scanf("%f %f %f %f %f %f %f %f", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &xp, &yp) != EOF){
		
		printf("%f %f %f %f %f %f %f %f\n", x[0], x[1], x[2], y[0], y[1], y[2], xp, yp);
		
		sM = ((x[1] - x[0]) * (y[2] - y[0]) - (x[2] - x[0]) * (y[1] - y[0])) / 2;
		printf("sM = %f\n", sM);
		if (sM < 0){
			sM *= -1;
		}
		
		printf("sM = %f\n", sM);
		
		s1 = ((xp - x[2]) * (y[1] - y[2]) - (x[1] - x[2]) * (yp - y[2])) / 2;
		if (s1 < 0){
			s1 *= -1;
		}
		
		printf("s1 = %f\n", s1);
		
		s2 = ((xp - x[2]) * (y[0] - y[2]) - (x[0] - x[2]) * (yp - y[2])) / 2;
		if (s2 < 0){
			s2 *= -1;
		}
		
		printf("s2 = %f\n", s2);
		
		s3 = ((xp - x[0]) * (y[1] - y[0]) - (x[1] - x[0]) * (yp - y[0])) / 2;
		if (s3 < 0){
			s3 *= -1;
		}
		
		printf("s3 = %f\n", s3);
		
		if (sM >= s1 + s2 + s3){
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	
	return (0);
}

C++: #include <iostream>

using namespace std;

typedef struct st_point {
	double x;
	double y;
} Point;

bool isPositiveFuncVal(double &a, double &b, double &c, Point &point);

int main(void)
{
	Point vertex[3] = {{0}, {0}, {0}};
	Point pointP = {0};
	
	while(cin >> vertex[0].x >> vertex[0].y >> vertex[1].x >> vertex[1].y >> vertex[2].x >> vertex[2].y >> pointP.x >> pointP.y){
		int i = 0;
		for(i = 0; i < 3; i++){
			double a = (vertex[i].y - vertex[(i+1)%3].y) / (vertex[i].x - vertex[(i+1)%3].x);
			double b = -1.0;
			double c = vertex[i].y - a * vertex[i].x;
			
			if( isPositiveFuncVal(a, b, c, vertex[(i+2)%3]) != isPositiveFuncVal(a, b, c, pointP) ){
				break;
			}
		}
		
		if(i == 3){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	
	return 0;
}

bool isPositiveFuncVal(double &a, double &b, double &c, Point &point)
{
	return a * point.x + b * point.y + c > 0 ? true : false;
}