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++: /*by SilverN*/
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
struct point{
    double x,y;
    point operator - (point rhs){return (point){x-rhs.x,y-rhs.y};}
    point operator + (point rhs){return (point){x+rhs.x,y+rhs.y};}
}p[5];
double Cross(point a,point b){return a.x*b.y-a.y*b.x;}
bool judge(){
	if(Cross(p[3]-p[1],p[2]-p[1])<0)swap(p[3],p[2]);
	if(Cross(p[2]-p[1],p[4]-p[1])>0)return 0;
	if(Cross(p[3]-p[2],p[4]-p[2])>0)return 0;
	if(Cross(p[1]-p[3],p[4]-p[3])>0)return 0;
	return 1;
}
int main(){
	int i,j;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",
		&p[1].x,&p[1].y,&p[2].x,&p[2].y,&p[3].x,&p[3].y,&p[4].x,&p[4].y)!=EOF){
		if(judge())printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define X real()
#define Y imag()
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using comd = complex<double>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(all(v),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double a,b,c,d,e,f,xp,yp;
  while(cin >> a >> b >> c >> d >> e >> f >> xp >> yp){
    bool f = true;
    double acx = c-a,abx = d-a,acy = d-b,aby = e-b,apx = xp-a,apy = yp - b;
    double t,s;
    if(acx == 0 || acy == 0){
      s = 0;
      t = apx/acx;
    }
    else if(abx == 0 || aby == 0){
      t = 0;
      s = apy/aby;
    }
    else{
      t = (abx * apy - apx * aby)/(acy - acx*aby);
      s = (apx - t * acx)/abx;
    }
    cout << s + t << endl;
    Ans(0 < t+s && t+s < 1);
  }
  return 0;
}

C++: //
//  practise.h
//  c++practise
//
//  Created by Ubnit04 on 2015/06/10.
//
//

#include <iostream>
#include <math.h>

using namespace std;

float getSquare(float x1, float y1, float x2, float y2, float x3, float y3)
{
    float xAB, yAB;
    float xBC, yBC;

    xAB = x2 - x1;
    yAB = y2 - y1;

    xBC = x3 - x2;
    yBC = y3 - y2;
    
    return fabs(xAB * yBC - yAB * xBC) / 2.0f; //square of tri-angle
    
}

void isIn()
{
    float x1, y1;
    float x2, y2;
    float x3, y3;
    float xp, yp;
    
    float sABC, sABP, sACP, sBCP;
    
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
    {
        sABC = getSquare(x1, y1, x2, y2, x3, y3);
        sABP = getSquare(x1, y1, x2, y2, xp, yp);
        sBCP = getSquare(x2, y2, x3, y3, xp, yp);
        sACP = getSquare(x1, y1, x3, y3, xp, yp);
        
        if(((sABC > 0) && (sBCP > 0) && (sACP > 0)) || ((sABC < 0) && (sBCP < 0) && (sACP < 0)))
        {
            if (sABC == sABP + sACP + sBCP) //if p is including triangle this should be worked
            {
                cout<<"YES"<<endl;
            }
            else if (sABC < sABP + sACP + sBCP)
            {
                cout<<"NO"<<endl;
            }
        }
    }
    
    return;
}

int main()
{
    isIn();
    return 0;
}

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

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 det[3];
    for (int i = 0; i < 3; i++) {
      double x0, y0;
      double xa, ya;
      double xb = xp, yb = yp;
      if (i == 0) { x0 = x1; y0 = y1; xa = x2; ya = y2; }
      else if (i == 1) { x0 = x2; y0 = y2; xa = x3; ya = y3; }
      else if (i == 2) { x0 = x3; y0 = y3; xa = x1; ya = y1; }
      xa -= x0; ya -= y0; xb -= x0; yb -= y0;
      det[i] = xa * yb - xb * ya;
    }
    if ((det[0] > 0 && det[1] > 0 && det[2] > 0) || 
        (det[0] < 0 && det[1] < 0 && det[2] < 0)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

struct point{ double x, 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;
  if(dx1*dy2 < dy1*dx2) return -1;
  if((dx1*dx2 < 0) || (dy1*dy2 < 0)) return -1;
  if((dx1*dx1+dy1*dy1) < (dx2*dx2+dy2*dy2)) return 1;
  return 0;
}

int main(){
  double x1, x2, x3, xp, y1, y2, y3, yp;
  while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) && x1+y1+x2+y2+x3+y3+xp+yp){
    point a, b, c, P;
    a.x = x1; a.y = y1;
    b.x = x2; b.y = y2;
    c.x = x3; c.y = y3;
    P.x = xp; P.y = yp;
    //    printf("%d %d %d\n", ccw(a, b, P), ccw(b, c, P), ccw(c, a,P));
    if(ccw(a, b, P) == ccw(b, c, P) && ccw(b, c, P) == ccw(c, a, P)) puts("YES");
    else puts("NO");
  }
  return 0;
}