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>
using namespace std;

#define fs first
#define sc second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define pb emplace_back

using pii = pair<int, int>;
using vi = vector<int>;
using lint = long long;

const int inf = 1001001001;
const lint linf = 1001001001001001001ll;
const int mod = 1e9 + 7;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};

template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; }
template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; }
template<typename T> inline void print(const vector<T> &v, string s = " ") 
{ rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); }
inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }
inline lint in() { lint x; std::cin>>x; return x; }

#define X real()
#define Y imag()
#define EQ(a,b) (abs((a)-(b)) < EPS)
typedef complex<double> P;
const double EPS = 1e-10;

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

double cross(P a, P b) {
	return (a.real() * b.imag() - a.imag() * b.real());
}

int is_point_on_line(P a, P b, P c) {
	if ( EQ(abs(a-c), 0.0) || EQ(abs(b-c), 0.0) ) return 1;

	if (a.real() < b.real()) {
		if (c.real() < a.real() || b.real() < c.real()) return 0;
	} else {
		if (c.real() < b.real() || a.real() < c.real()) return 0;
	}

	if (a.imag() < b.imag()) {
		if (c.imag() < a.imag() || b.imag() < c.imag()) return 0;
	} else {
		if (c.imag() < b.imag() || a.imag() < c.imag()) return 0;
	}

	return EQ( cross(b-a, c-a), 0.0 );
}

bool is_intersected(P a1, P a2, P b1, P b2) {
	return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < -EPS ) &&
		( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < -EPS );
}

int main() {
	double latte[4], beet[4];
	while (cin >> latte[0]) {
		rep(i, 4) {
			if (i == 0) cin >> beet[0];
			else cin >> latte[i] >> beet[i];
		}

		P a[3], r;

		rep(i, 3) {
			a[i] = P(latte[i], beet[i]);
		}

		r = P(latte[3], beet[3]);

		bool f = false;
		rep(i, 3) {
			if (a[i] == r) f = true;
		}
		rep(i, 3) {
			if (is_point_on_line(a[i], a[(i + 1) % 3], r)) {
				f = true;
			}
		}
		if (f) {
			cout << "NO" << endl;
			continue;
		}

		int ans = 1;
		int cnt = 0;
		rep(_, 4) {
			rep(i, 3) {
				cnt += is_intersected(a[i], a[(i + 1) % 3], r, P(100.1 * (_ & 2 ? 1 : -1), 100.1 * (_ & 1 ? 1 : -1)));
			}
			ans *= cnt;
		}

		cout << (ans ? "YES" : "NO") << endl;
	}
}

C++: #include <stdio.h>

int main(void) {

  double x1,y1,x2,y2,x3,y3,xp,yp;

  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF) {

    double s,t;

    s=(double)((y3-y1)*(xp-x1)-(x3-x1)*(yp-y1))/(double)((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1));

    t=(double)((x2-x1)*(yp-y1)-(xp-x1)*(y2-y1))/(double)((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1));

    if(s+t<1) {
      printf("%lf %lf",s,t);
      printf("YES\n");

    } else {
      printf("%lf %lf",s,t);      
      printf("NO\n");

    }
       
  }
   
  return 0;

}

C++: #include<cstdio>
#include<cmath>

double getd(double x, double y){
	double r = atan2(y, x) * 180 / M_PI;
	return r;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp,d1,d2,d3;
	double h;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) + 1){
		x1 -= xp;
		x2 -= xp;
		x3 -= xp;
		y1 -= yp;
		y2 -= yp;
		y3 -= yp;
		d1 = getd(x1,y1);
		d2 = getd(x2,y2);
		d3 = getd(x3,y3);
		if(d1 > d2){
			h = d1;
			d1 = d2;
			d2 = h;
		}
		if(d2 > d3){
			h = d2;
			d2 = d3;
			d3 = h;
			if(d1 > d2){
				h = d1;
				d1 = d2;
				d2 = h;
			}
		}
		d2 -= d1;
		d3 -= d1;
		if(180 < d3 && d3 < d2 + 180){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>

struct Point{
	double x, y;
};
typedef Point Vector;

double ExteriorProduct(Vector v1, Vector v2){
	return v1.x*v2.y-v2.x*v1.y;
}

int Abs(int i){
	return i>0?i:-i;
}

int main(){
	Point ps[3], p;
	while(true){
		for(int i=0;i<3;i++){
			std::cin >> ps[i].x >> ps[i].y;
		}
		if(std::cin.eof())break;

		std::cin >> p.x >> p.y;

		int count = 0;
		for(int i=0;i<3;i++){
			Vector pv, v; //点Pからのベクトルと辺のベクトル
			Point first_p = ps[i], second_p = ps[(i+1)%3];
			pv = {p.x-first_p.x, p.y-first_p.y};
			v = {first_p.x-second_p.x, first_p.y-second_p.y};
			if(ExteriorProduct(pv, v) > 0){
				count++;
			}
		}

		if(Abs(count) == 3){
			std::cout << "YES\n";
		}else{
			std::cout << "NO\n";
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <cmath>
using namespace std;

float S(float a, float b, float c, float d, float e, float f) {
	float ans;
	ans = abs((a - e) * (d - f) - (b - f) * (c - e));
	return ans/2;
}

int main(){
	float x[4], y[4], SS, SSS;

	while(true){
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
		if (cin.eof()) { break; }
		SS = S(x[0], y[0], x[1], y[1], x[3], y[3]) + S(x[0], y[0], x[2], y[2], x[3], y[3]) + S(x[1], y[1], x[2], y[2], x[3], y[3]);
		SSS = S(x[0], y[0], x[1], y[1], x[2], y[2]);

		if (SS == SSS) { cout << "YES" << endl; }
		else { cout << "NO" << endl; }
	}
	return 0;
}