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 <algorithm>
#include <deque>
#include <functional>


using namespace std;

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp;
	
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
	{
		deque<double> nums;
		nums.push_back(x1);
		nums.push_back(x2);
		nums.push_back(x3);
		sort( nums.begin(), nums.end());
		
		deque<double>::iterator it = nums.begin();
		double a,b,c,d;

		a = *it;
		it += 2;
		b = *it;

		nums.clear();

		nums.push_back(y1);
		nums.push_back(y2);
		nums.push_back(y3);
		sort( nums.begin(), nums.end());
		
		it = nums.begin();
		c = *it;
		it += 2;
		d = *it;

		int ture=0;
		
		if(xp<a) ;
		else if(b<xp);
		else ture++;

		if(yp<c) ;
		else if(d<yp);
		else ture++;

		if(ture==2) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;

	}

	return 0;
}

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

int main(){
	int rail[11];
	int num=0;
	while(true){
		int now;
		cin >> now;
		if(cin.eof())
			break;
		else if(now ==0){
			cout << rail[num] << endl;
			num--;
		}
		else{
			num++;
			rail[num] = now;
		}
	
	}
	return 0;

}

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

int main(){
	string str[100];
	int k = -1;
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		k++;
		for(int i = 0; i < 3; i++){
			if(y1 != y2 && x1 != x2){
				double b, c, d;
				b = (x1-x2)/(-y1+y2);
				c = (-y1*x2+y2*x1)/(-y1+y2);
				d = x3+b*y3;
				if(((c-xp)/b > yp && yp < (d-xp)/b) || ((c-xp)/b < yp && yp > (d-xp)/b)){
					str[k] = "NO";
					continue;
				}
			}
			else if(y1 == y2){
				if((y1 > yp && yp < y3) || (y1 < yp && yp > y3)){
					str[k] = "NO";
					continue;
				}
			}
			else if(x1 == x2){
				if((x1 > xp && xp < x3) || (x1 < xp && xp > x3)){
					str[k] = "NO";
					continue;
				}
			}
			str[k] = "YES";
			swap(x2,x3);
			swap(x2,x1);
			swap(y2,y3);
			swap(y2,y1);
		}
	}
	for(int i = 0; i < k+1; i++){
		cout << str[i] << endl;
	}
}

C++: #include <iostream>
using namespace std;
const int INF = 1<<29;

int main(){
	double X[3], Y[3];
	double px, py;
	while( cin >> X[0] >> Y[0] >> X[1] >> Y[1] >> X[2] >> Y[2] >> px >> py ){
		int cnt = 0;
		for( int i=0; i<3; i++ ){
			if( (X[(i+1)%3]-X[i])*(py-Y[i]) - (px-X[i])*(Y[(i+1)%3]-Y[i]) > 0 ) cnt++;
		}
		if( cnt%3 ) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
}

C++: #include<iostream>
using namespace std;
int main(){
	double x[3],y[3],xp,yp,r,xmax,xmin,ymax,ymin;
	int sum;
	while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>xp>>yp){
		xmax=max(x[0],max(x[1],x[2]));
		ymax=max(y[0],max(y[1],y[2]));
		xmin=min(x[0],min(x[1],x[2]));
		ymin=min(y[0],min(x[1],x[2]));
		sum=0;
		if(x[0]-x[1]==0)
			;
		else{
			r=(y[0]-y[1])*(xp-x[0])/(x[0]-x[1])+y[0];
		if(yp<r&&r>=ymin&&r<=ymax)
			sum++;
		}
		if(x[0]-x[2]==0)
		;
		else{
		r=(y[0]-y[2])*(xp-x[0])/(x[0]-x[2])+y[0];
		if(yp<r&&r>=ymin&&r<=ymax)
			sum++;
		}
		if(x[2]-x[1]==0)
			;
		else{
		r=(y[2]-y[1])*(xp-x[2])/(x[2]-x[1])+y[2];
			if(yp<r&&r>=ymin&&r<=ymax)
			sum++;
		}
		if(sum==1&&xp>=xmin&&xp<=xmax)
		cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<complex>
#include<cmath>
#include<queue>
using namespace std;
typedef complex<double> xy_t;
double cross_product(xy_t p,xy_t q);
{
  return (conj(p)*q).imag();
}
int main()
{
  double x[4],y[4];
  while(true){
    for( int i = 0; i < 4; ++i) cin >> x[i] >> y[i];
    if(!cin) break;
    xy_t a(x[0],y[0]),b(x[1],y[1]),c(x[2],y[2]),p(x[3],y[3]);
    double S1,S2,S3;
    S1 = cross_product(a - p, b - p);
    S2 = cross_product(b - p, c - p);
    S3 = cross_product(c - p, a - p);
    bool ok = (S1 > 0 && S2 > 0 && S3 > 0) || (S1 < 0 && S2 < 0 && S3 < 0);
    cout << (ok ? "YES":"NO") << endl;
  }
}

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

#define FOR(i, a) for(int i=0;i<(int)a;++i)
typedef long long ll;
typedef long double ld;
using namespace std;

typedef struct point {
    ld x, y;
} POINT;

bool sign(POINT p1, POINT p2, POINT p3) {
    return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y) > 0;
}

bool pointInTraiangle(POINT x, POINT a, POINT b, POINT c) {
    return sign(x, a, b) && sign(x, b, c) && sign(x, c, a);
}

void solver() {
    ld x1, x2, x3, xp, y1, y2, y3, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        POINT p1,p2,p3,pp;
        p1.x=x1;p1.y=y1;
        p2.x=x2;p2.y=y2;
        p3.x=x3;p3.y=y3;
        pp.x=xp;pp.y=yp;
        if (pointInTraiangle(pp,p1,p2,p3)) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

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

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	double x[4], y[4];
	bool left, right;
	double ax, ay, px, py;

	while(1){
		for(int i = 0; i < 4; i++){
			if(!(cin >> x[i] >> y[i])){
				return 0;
			}
		}

		left = false;
		right = false;
		for(int i = 0; i < 3; i++){
			ax = x[(i+1)%3]-x[i];
			ay = y[(i+1)%3]-y[i];
			px = x[3] - x[i];
			py = y[3] - y[i];
			if( ax*py-px*ay < 0){
				right = true;
				break;
			}else{
				left = true;
			}
		}

		if(left^right){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}

	return 0;
}

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

struct TCoordinate
{
	double x;
	double y;
};

double GetCrossProduct(const TCoordinate& V1, const TCoordinate& V2)
{
	return V1.x * V2.y - V1.y * V2.x;
}

bool IsSameSide(const TCoordinate& T1, const TCoordinate& T2, const TCoordinate& L1, const TCoordinate& L2)
{
	TCoordinate VectorL1T1 = {T1.x - L1.x, T1.y - L1.y};
	TCoordinate VectorL1T2 = {T2.x - L1.x, T2.y - L1.y};
	TCoordinate VectorL1L2 = {L2.x - L1.x, L2.y - L1.y};
	return GetCrossProduct(VectorL1T1, VectorL1L2) * GetCrossProduct(VectorL1T2, VectorL1L2) > 0;
}

int main()
{
	while(true){
		TCoordinate A1, A2, A3, Ap;
		cin >> A1.x >> A1.y >> A2.x >> A2.y >> A3.x >> A3.y >> Ap.x >> Ap.y;
		if(cin.eof() == true) break;
		if(IsSameSide(A3, Ap, A1, A2) && IsSameSide(A1, Ap, A2, A3) && IsSameSide(A2, Ap, A3, A1)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}