Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <algorithm>

using namespace std;


bool solve(){
	complex<double> a,b,c,p;
	while(cin>> a.real()>> a.imag()){
		cin>> b.real()>> b.imag();
		cin>> c.real()>> c.imag();
		cin>> p.real()>> p.imag();
		
		complex<double> B,C,P;
		B = b - a;
		C = c - a;
		P = p - a;
		double b1 = B.real();
		double b2 = B.imag();
		double c1 = C.real();
		double c2 = C.imag();
		double p1 = P.real();
		double p2 = P.imag();
		
		//p = xB+yC
		double x = (p1*c2-p2*c1) / (b1*c2-b2*c1);
		double y = (p2*b1-p1*b2) / (b1*c2-b2*c1);
		
		if(0<x && 0<y && 0<x+y && x+y<1){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(5);
	solve();

	return 0;
}

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

int main(void) {
	double x[4], y[4];
	double xp, yp;

	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) {
		bool l, r;
		l = r = false;
		
		x[3] = x[0];
		y[3] = y[0];

		for(int i = 0; i < 3; i++) {
			double ax = x[i+1] - x[i];
			double ay = y[i+1] - y[i];
			double px = xp - x[i];
			double py = yp - y[i];
			if(ax*py - ay*px < 0)
				r = true;
			else
				l = true;
		}
		cout << (r != l ? "YES" : "NO") << endl;
	}
	return 0;
}

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

typedef complex<double> P;
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) <EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

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

// a1,a2ツづーツ端ツ点ツづつキツづゥツ静シツ閉ェツづ1,b2ツづーツ端ツ点ツづつキツづゥツ静シツ閉ェツづ個古ーツ債キツ板サツ津ィ
int is_intersected_ls(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(void){
	P A,B,C,PO;
	
	while(cin>>A.real()>>A.imag()>>B.real()>>B.imag()>>C.real()>>C.imag()>>PO.real()>>PO.imag()){
		
		if(is_intersected_ls(A,PO,B,C)){
			cout<<"NO"<<endl;
			continue;
		}
		if(is_intersected_ls(B,PO,A,C)){
			cout<<"NO"<<endl;
			continue;
		}
		if(is_intersected_ls(C,PO,A,B)){
			cout<<"NO"<<endl;
			continue;
		}
		cout<<"Yes"<<endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>

#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define int(x) int x;scanf("%d",&x);
#define double(x) double x;scanf("%lf",&x);
#define string(x) double string;cin>>x;

using namespace std;

int main()
{
	float x1, x2, x3, y1, y2, y3, xp, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
	{

		float x_max, x_min, y_max, y_min;
		x_max = max(x1, max(x2, x3));
		x_min = min(x1, min(x2, x3));
		y_max = max(y1, max(y2, y3));
		y_min = min(y1, min(y2, y3));

		if (xp <= x_max&&xp >= x_min&&yp >= y_min&&yp <= y_max) {
			cout << "YES\n";
		}
		else {
			cout << "NO\n";
		}
	}

	return 0;
}

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

// _ÀWð^Æ·é
typedef complex<double> P;
// ÎÌè`
#define PI 3.1415926535898

// e·éë·Ã
#define EPS (1e-10)
//XYÀW
#define X real()
#define Y imag()

//QÂÌdouble^Ìlªµ¢©Ç¤©
bool equal(double a, double b){
	return ( abs( a-b ) < EPS )? true : false ;
}
	
// Op`NX
class Triangle{

private:
	//Op`ÌR_ÌÀW
	P a, b, c;
	//Op`ÌRÓÌ·³
	double edgeA,edgeB,edgeC;
	//Op`ÌRpÌå«³(WA)
	double angleA,angleB,angleC;
	//]·è©çRÂÌpxðßéÖ
	double LawOfCosines(double a,double b, double c){
		return acos( (b*b+c*c-a*a) / (2.0*b*c) );
	}
	
public:
	//RXgN^(RÂÌ_ÆÓÆpxðú»)
	Triangle(P p1, P p2, P p3){
		a = p1;
		b = p2;
		c = p3;
		edgeB = abs(c-a);
		edgeA = abs(b-c);
		edgeC = abs(a-b);
		angleA = LawOfCosines(edgeA,edgeB,edgeC);
		angleB = LawOfCosines(edgeB,edgeC,edgeA);
		angleC = LawOfCosines(edgeC,edgeA,edgeB);
	}
	double getAngleC(){//pCÌpxðÏ¦·
		return angleC;
	}
};

int main(){
	double x1, x2, x3, y1, y2, y3, xp, yp, angle;

	while( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp ){
		P a( x1 , y1 );
		P b( x2 , y2 );
		P c( x3 , y3 );
		P p( xp , yp );
		Triangle Tr1(a,b,p);
		Triangle Tr2(b,c,p);
		Triangle Tr3(c,a,p);
		angle = Tr1.getAngleC() + Tr2.getAngleC() + Tr3.getAngleC();
		( equal( 2.0*PI , angle) )? cout << "YES" : cout << "NO" ;
		cout << 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, u;
    x1 -= xp, x2 -= xp, x3 -= xp;
    y1 -= yp, y2 -= yp, y3 -= yp;
    printf("%f %f %f %f %f %f\n", x1, y1, x2, y2, x3, y3);
    s = x1 * y2 - x2 * y1;
    if(!s) {
      printf("NO\n");
      continue;
    }
    s = s < 0 ? 0 : 1;
    t = x2 * y3 - x3 * y2;
    if(!t) {
      printf("NO\n");
      continue;
    }
    t = t < 0 ? 0 : 1;
    u = x3 * y1 - x1 * y3;
    if(!u) {
      printf("NO\n");
      continue;
    }
    u = u < 0 ? 0 : 1;
    //printf("%d %d %d\n", s, t, u);
    if(s == t && t == u) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}

C++: /*problem C*/

#include<stdio.h>

typedef struct{
	double x,y;
}point_obj;

int isClossLine(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
	return ( (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

int main(){
	point_obj p[5];
	int i,j;
	p[3].x=0;
	p[3].y=0;

	while(cin>>p[0].x){
		cin>>p[0].y;

		p[3].x=p[0].x;
		p[3].y=p[0].y;

		for(int i=0;i<3;i++){
			cin>>p[i].x,cin>>p[i].y;

		p[3].x+=p[i].x;
		p[3].y+=p[i].y;
		}
			p[3].x+=p[0].x;
			p[3].y+=p[0].y;
	
			p[3].x/=3.0;
			p[3].y/=3.0;

			if(isClossLine(p[0].x,p[0].y,p[1].x,p[1].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0 &&
				isClossLine(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) >0 &&
				isClossLine(p[0].x,p[0].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0){

				printf("YES");
			}

			else{
				printf("NO");
			}
		}
	}
	
	return 0;
}