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;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

constexpr double EPS = 1e-9;

//???
class Point{
public:
    double x,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 * (double a){ return Point( a*x , a*y ); }
    Point operator / (double a){ return Point( x/a , y/a ); }

    double abs(){   //??§??????
        return sqrt(norm());
    }

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

    bool operator == (const Point &p) const{
        return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
    }
};

using Vector = Point;

double cross(Vector a,Vector b){ return a.x*b.y-a.y*b.x; }

void solve(Point p1,Point p2,Point p3,Point pin){

    //cout << p1.x << " " << p1.y << " " << p2.x << " " <<p2.y << " " <<p3.x << " " << p3.y << " " << pin.x << " " <<pin.y << endl;

    bool ok = true;
    Point p[3] = {p1,p2,p3};

    for(int i=0;i<3;i++){
        Vector v1 = Vector(p[(i+1)%3]-p[i]);
        Vector v2 = Vector(p[(i+2)%3]-p[i]);
        Vector vin = Vector(pin-p[i]);

        double c1 = cross(v1,vin);
        double c2 = cross(v1,v2);
        if(c1*c2 < -EPS) ok=false;
    }
    if(ok) cout << "YES" << endl;
    else cout << "NO" << endl;
}

int main(){
    while(true){
        double x1,x2,x3,xin,y1,y2,y3,yin;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xin >> yin;
        if(cin.eof()) break;
        solve(Point(x1,y1),Point(x2,y2),Point(x3,y3),Point(xin,yin));
    }
}

C++: /* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 

*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << '\n';
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}

/* }}} */

typedef pair<double, double> P;

double cross(P& a, P& b) {
  return a.Fi * b.Se - a.Se * b.Fi;
}

P operator +(P& a, P& b) {
  return mp(a.Fi + b.Fi, a.Se + b.Se);
}
P operator -(P& a, P& b) {
  return mp(a.Fi - b.Fi, a.Se - b.Se);
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  P n[3];
  P p;

  while (cin >> n[0].Fi >> n[0].Se) {
    RREP(i, 2) cin >> n[i].Fi >> n[i].Se;
    cin >> p.Fi >> p.Se;
    bool flg = true;
    P v[] = {n[1] - n[0], n[2] - n[1], n[0] - n[2]};
    int check = 0;
    REP(i, 3) {
      P t = p - n[i];
      check += (cross(v[i], t) > 0) ? 1 : -1;
    }
    if (check == 3 || check == -3) print("YES");
    else print("NO");
  }

  return 0;
}

C++: // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0012

#include <iostream>
using namespace std;

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

	while (cin >> x1 >> y1
		       >> x2 >> y2 
		       >> x3 >> y3
		       >> xp >> yp) {

		double l1_x = (y2 - y3);
		double l1_y = -(x2 - x3);
		double l1_c = -(y2 - y3)*x3 + y3;
		
		double l2_x = (y1 - y3);
		double l2_y = -(x1 - x3);
		double l2_c = -(y1 - y3)*x3 + y3;

		double l3_x = (y1 - y2);
		double l3_y = -(x1 - x2);
		double l3_c = -(y1 - y2)*x2 + y2;

		if ((l1_x * xp + l1_y * yp + l1_c)*l1_c >= 0 &&
			(l2_x * xp + l2_y * yp + l2_c)*l2_c >= 0 &&
			(l3_x * xp + l3_y * yp + l3_c)*l3_c >= 0)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <complex>
#include <vector>

using namespace std;

typedef complex<double> point;
double cross(point a,point b){
    return imag(conj(a)*b);
}
double dot(point a,point b){
    return real(conj(a)*b);
}
int ccw(point a,point b,point c){
    b -= a; c-= a;
    if(cross(b,c) > 0) return 1;
    if(cross(b,c) < 0) return -1;
    if(dot(b,c) < 0) return 2;
    if(norm(b) < norm(c) ) return -2;
    return 0;
}

int main(){
    while(cin){
        vector<point> P;
        for(int i=0;i<3;i++){
            double y,x;
            if(not (cin >> x >> y)){
                goto end;
            }
            P.push_back(point(x,y));
        }
        point inner;
        cin >> inner.real() >> inner.imag();
        if((ccw(P[0],P[1],inner) == 1 and
            ccw(P[1],P[2],inner) == 1 and
            ccw(P[2],P[0],inner) == 1) or 
           (ccw(P[0],P[1],inner) == 1 and
            ccw(P[1],P[2],inner) == 1 and
            ccw(P[2],P[0],inner) == 1)){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
end:;
    return 0;
}