Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func check(x, y, x1, y1, x2, y2 float64) float64 {
	return (x2-x1)*y - (y2-y1)*x + x1*y2 - x2*y1
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]float64, 8)
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		for j := 0; j < 8; j++ {
			a[j], _ = strconv.ParseFloat(info[j], 64)
		}
		if check(a[0], a[1], a[2],a[3], a[6], a[7])*check(a[4], a[5], a[2], a[3], a[6], a[7]) < 0 && check(a[6], a[7], a[0], a[1], a[4], a[5])*check(a[2],a[3], a[0], a[1], a[4], a[5]) < 0 {
			fmt.Println("YES")	
		} else {
			fmt.Println("NO")
		}
	}
}

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

double pos[4][2];
int solve(){
    double a, b, c, d;
    a = (pos[0][1] - pos[2][1])*(pos[1][0] - pos[0][0]);
    a -= (pos[0][0] - pos[2][0])*(pos[1][1] - pos[0][1]);
    b = (pos[0][1] - pos[2][1])*(pos[3][0] - pos[0][0]);
    b -= (pos[0][0] - pos[2][0])*(pos[3][1] - pos[0][1]);
    c = (pos[1][1] - pos[3][1])*(pos[0][0] - pos[1][0]);
    c -= (pos[1][0] - pos[3][0])*(pos[0][1] - pos[1][1]);
    d = (pos[1][1] - pos[3][1])*(pos[2][0] - pos[1][0]);
    d -= (pos[1][0] - pos[3][0])*(pos[2][1] - pos[1][1]);
    if(a*b<=0 && c*d<=0){
        return true;
    }else{
        return false;
    }
}
int main(){
    int i, j;
    char comma;
    while(cin >> pos[0][0]){
        cin >> comma >> pos[0][1];
        for(i=1;i<4;i++){
            for(j=0;j<2;j++){
                cin >> comma >> pos[i][j];
            }
        }
        if(solve()){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

#define AB2 ((x[1] - x[0])*(x[1] - x[0]) + (y[1] - y[0])*(y[1] - y[0]))
#define BC2 (x[2] - x[1])*(x[2] - x[1]) + (y[2] - y[1])*(y[2] - y[1])
#define CD2 (x[3] - x[2])*(x[3] - x[2]) + (y[3] - y[2])*(y[3] - y[2])
#define DA2 (x[0] - x[3])*(x[0] - x[3]) + (y[0] - y[3])*(y[0] - y[3])
#define CA2 (x[0] - x[2])*(x[0] - x[2]) + (y[0] - y[2])*(y[0] - y[2])
#define BD2 (x[3] - x[1])*(x[3] - x[1]) + (y[3] - y[1])*(y[3] - y[1])

int main(){
  double x[4], y[4];
  bool rad = true;
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]) != EOF){
    if((x[1] - x[0]) * (x[3] - x[0]) + (y[1] - y[0]) * (y[3] - y[0]) < 0){
      rad = false;
    }
    if((x[0] - x[3]) * (x[2] - x[3]) + (y[0] - y[3]) * (y[2] - y[3]) < 0){

      rad = false;
    }
    if((x[3] - x[2]) * (x[1] - x[2]) + (y[3] - y[2]) * (y[1] - y[2]) < 0){

      rad = false;
    }
    if((x[0] - x[1]) * (x[2] - x[1]) + (y[0] - y[1]) * (y[2] - y[1]) < 0){

      rad = false;
    }
    if(rad == true){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
}

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

using namespace std;

bool check(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
	double res1 = (y2-y1)*(x3-x1)/(x2-x1)-(y3-y1), res2 = (y2-y1)*(x4-x1)/(x2-x1)-(y4-y1);
	if (res1 > 0 && res2 > 0) return false;
	if (res1 < 0 && res2 < 0) return false;
	if (res1 == 0 || res2 == 0) return false;
	return true;

}
int main() {
	double a,b,c,d,e,f,g,h;
	while (scanf("%f,%f,%f,%f,%f,%f,%f,%f\n",a,b,c,d,e,f,g,h)!=EOF) {
		if (check(a,b,e,f,c,d,g,h) && check(c,d,g,h,a,b,e,f)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

using namespace std;
double x[4], y[4];
double ab, bc, cd, da, ac, bd;

double len(double x1, double y1, double x2, double y2)
{
    return sqrt(pow(x1-x2, 2.0) + pow(y1-y2, 2.0));
}

// Heron's Formula
double square(double a, double b, double c)
{
    double s = (a + b + c) / 2.0;
    return sqrt(s * (s-a) * (s-b) * (s-c));
}


int main(void)
{
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",x,y,x+1,y+1,x+2,y+2,x+3,y+3)) {
        ab = len(x[0],y[0],x[1],y[1]);
        bc = len(x[1],y[1],x[2],y[2]);
        cd = len(x[2],y[2],x[3],y[3]);
        da = len(x[3],y[3],x[1],y[1]);
        ac = len(x[0],y[0],x[2],y[2]);
        bd = len(x[3],y[3],x[1],y[1]);
        double s1,s2,s3,s4;
        s1 = square(ab, bd, da);
        s2 = square(cd, bd, bc);
        s3 = square(ac, cd, da);
        s4 = square(ab, bc, ac);
        double comp1;
        comp1 = (s1+s2) - (s3+s4);

        if(fabs(comp1) <= 0.001)
            puts("YES");
        else
            puts("NO");
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

struct Vector2D{
	double x;
	double y;
};

double gaiseki(Vector2D* a , Vector2D* b){
	return (a->x)*(b->y)-(a->y)*(b->x);
}

int main(){
	double xa,ya,xb,yb,xc,yc,xd,yd;
	char c;
	while(cin>>xa>>c>>ya>>c>>xb>>c>>yb>>c>>xc>>c>>yc>>c>>xd>>c>>yd){
		Vector2D ab ,ad , bc , ba , ca , cb , cd , ac , da , bd , dc , db;
		ab.x=xb-xa;
		ab.y=yb-ya;
		ad.x=xd-xa;
		ad.y=yd-ya;
		bc.x=xc-xb;
		bc.y=yc-yb;
		bd.x=xd-xb;
		bd.y=yd-yb;
		ba.x=xa-xb;
		ba.y=ya-yb;
		ca.x=xa-xc;
		ca.y=ya-yc;
		cb.x=xb-xc;
		cb.y=yb-yc;
		cd.x=xd-xc;
		cd.y=yd-yc;
		ac.x=xc-xa;
		ac.y=yc-ya;
		da.x=xa-xd;
		da.y=ya-yd;
		bd.x=xd-xb;
		bd.y=yd-yb;
		db.x=xb-xd;
		db.y=yb-yd;
		dc.x=xc-xd;
		dc.y=yc-yd;
		double abac , bdbc , dadc;
		double abad , bcbd , cacd;
		double bcba , cdca , dbda;
		double cdcb , dadb , acab;
		abac=gaiseki(&ab , &ac);
		bdbc=gaiseki(&bd , &bc);
		dadc=gaiseki(&da , &dc);
		abad=gaiseki(&ab , &ad);
		bcbd=gaiseki(&bc , &bd);
		cacd=gaiseki(&ca , &cd);
		bcba=gaiseki(&bc , &ba);
		cdca=gaiseki(&cd , &ca);
		dbda=gaiseki(&db , &da);
		cdcb=gaiseki(&cd , &cb);
		dadb=gaiseki(&da , &db);
		acab=gaiseki(&ac , &ab);
		if((abac<0 && bdbc<0 && dadc<0)||(abac>0 && bdbc>0 && dadc>0 )) cout << "NO" << endl;
		else if((abad<0 && bcbd<0 && cacd<0) || (abad>0 && bcbd>0 && cacd>0)) cout << "NO" << endl;
		else if((bcba<0 && cdca<0 && dbda<0) || (bcba>0 && cdca>0 && dbda>0)) cout << "NO" << endl;
		else if((cdcb<0 && dadb<0 && acab<0) || (cdcb>0 && dadb>0 && acab>0)) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0; 
}

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

int Hekomi(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {

	double A, B, C;
	A = (x2 - x1)*(y4 - y1) - (y2 - y1)*(x4 - x1);
	B = (x3 - x2)*(y4 - y2) - (y3 - y2)*(x4 - x2);
	C = (x1 - x3)*(y4 - y3) - (y1 - y3)*(x4 - x3);
	if ((A > 0 && B > 0 && C > 0) || (A < 0 && B < 0 && C < 0))
		return 0;
	else
		return 1;
}

int main() {

	double x1, x2, x3, x4, y1, y2, y3, y4;
	char a;
	vector<int> TF;

	while (cin >> x1 >> a  >> y1 >> a >> x2 >> a >> y2 >> a >> x3 >> a >> y3 >> a >> x4 >> a >> y4) {
		TF.push_back(1);
		if (Hekomi(x1, y1, x2, y2, x3, y3, x4, y4) == 0) {
			TF.pop_back(); 
			TF.push_back(0);
		}
		if (Hekomi(x1, y1, x2, y2, x4, y4, x3, y3) == 0){
			TF.pop_back(); 
			TF.push_back(0);
		}
		if (Hekomi(x1, y1, x4, y4, x3, y3, x2, y2) == 0){
			TF.pop_back(); 
			TF.push_back(0);
		}
		if (Hekomi(x4, y4, x2, y2, x3, y3, x1, y1) == 0){
			TF.pop_back(); 
			TF.push_back(0);
		}
		
	}
	for (int i = 0; i < TF.size(); i++) {
		if (TF[i])cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}