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() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	double s, t;

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

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

		if(s > 0 && t > 0 && s + t < 1)
			printf("YES\n");
		else
			printf("NO\n");
	}

	return 0;
}

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

struct point{
	double x;
	double y;
};

int ccw(point p0, point p1, point p2){
	double dx1, dx2, dy1, dy2;
	dx1 = p1.x - p0.x;
	dy1 = p1.y - p0.y;
	dx2 = p2.x - p0.x;
	dy2 = p2.y - p0.y;
	if(dx1 * dy2 > dy1 * dx2) return 1;
	else return -1;
}

int main(){
	point p1, p2, p3, p0;
	while(cin >> p1.x >> p1.y >> p2.x >>p2.y
		>> p3.x >> p3.y >> p0.x >> p0.y)
	{
		if((ccw(p0, p1, p2 ) != ccw(p0, p1, p3))
			&& (ccw(p0, p2, p1) != ccw(p0, p2, p3)))
			cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

int main() {
  double x1,y1,x2,y2,x3,y3,xp,yp;
  double a[2],b[2];
  double A,B;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    a[0] = x2 - x1;
    a[1] = y2- y1;
    b[0] = x3 - x1;
    b[1] = y3 - y1;
    //vect[0] = A * a[0] + B * b[0];
    //vect[1] = A * a[1] + B * b[1];
    A = (xp * b[1] - b[0] * yp) / (a[0] * b[1] - b[0] * a[1]);
    B = (a[0] * yp - xp * a[1]) / (a[0] * b[1] - b[0] * a[1]);
    if ((A+B <= 1) && (A > 0) && (B > 0)) {
      cout << "YES" << endl;
    }
    else {
      cout << "NO" << endl;
    }
  }
}

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

class point{ // as necessary
	private:
		static const double EPS=1e-5;
	public:
		static const int COUNTER_CLOCKWISE=1;
		static const int CLOCKWISE=-1;
		static const int ONLINE_BACK=2;
		static const int ONLINE_FRONT=-2;
		static const int ON_SEGMENT=0;

		double x;
		double y;
		point(double x=0,double y=0):x(x),y(y){}

		point operator+(point p){return point(x+p.x,y+p.y);}
		point operator-(point p){return point(x-p.x,y-p.y);}
		point operator*(const double a){return point(x*a,y*a);}
		point operator/(const double a){return point(x/a,y/a);}

		static double dot(const point &p1,const point &p2){
			return p1.x*p2.x+p1.y*p2.y;
		}

		double norm(){
			return x*x+y*y;
		}

		double abs(){
			return sqrt(norm());
		}

		static double cross(point p1,point p2){
			return p1.x*p2.y-p1.y*p2.x;
		}

		static int ccw(point p0,point p1,point p2){
			point a=p1-p0; // ??????p0p1
			point b=p2-p0; // ??????p0p2
			if(cross(a,b)>EPS) return COUNTER_CLOCKWISE; // a????????????b??????????¨?
			if(cross(a,b)<-EPS) return CLOCKWISE; // a????????????b???????¨?
			if(dot(a,b)<-EPS) return ONLINE_BACK; // p2-p0-p1???????????¢???
			if(a.norm(),b.norm()) return ONLINE_FRONT; // p0-p1-p2???????????¢???
			return ON_SEGMENT; // p0-p2-p1???????????¢???
		}
};

int main(void){
	double x,y;
	while(cin>>x>>y){
		int rcw=0;
		int cw=0;
		point a(x,y);
		cin>>x>>y;
		point b(x,y);
		cin>>x>>y;
		point c(x,y);
		cin>>x>>y;
		point d(x,y);
		switch(point::ccw(d,a,b)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(d,b,c)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(d,c,a)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		if(rcw==1&&cw==2)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
}

C++: #include <iostream>
using namespace std;
bool judge_Cross(double, double, double, double);

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		double pax = x1 - xp;
		double pay = y1 - yp;
		double pbx = x2 - xp;
		double pby = y2 - yp;
		double pcx = x3 - xp;
		double pcy = y3 - yp;

		if ((judge_Cross(pax, pay, pbx, pay) && judge_Cross(pbx, pby, pcx, pcy) && judge_Cross(pcx, pcy, pax, pay)) ||
			!((judge_Cross(pax, pay, pbx, pay) || judge_Cross(pbx, pby, pcx, pcy) || judge_Cross(pcx, pcy, pax, pay)))) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

bool judge_Cross(double x1,double y1,double x2,double y2) {
	if (x1 * y2 - x2 * y1 > 0.0) {
		return true;
	} else {
		return false;
	}
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

bool existIntersection(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
  return ((x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)) *
           ((x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)) <
         0;
}

void solve() {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    if ((x1 - x3) * (y1 - y2) == (x1 - x2) * (y1 - y3)) {
      cout << "NO" << endl;
      break;
    }
    double gx = (x1 + x2 + x3) / 3;
    double gy = (y1 + y2 + y3) / 3;
    if (existIntersection(x1, y1, x2, y2, xp, yp, gx, gy)) {
      cout << "NO" << endl;
      break;
    }
    if (existIntersection(x2, y2, x3, y3, xp, yp, gx, gy)) {
      cout << "NO" << endl;
      break;
    }
    if (existIntersection(x3, y3, x1, y1, xp, yp, gx, gy)) {
      cout << "NO" << endl;
      break;
    }
    cout << "YES" << endl;
  }
}