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<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;


double dist(double x1,double y1,double x2,double y2){

    return sqrt( (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1) );

}

double deg(double a,double b,double c){

    return acos( (a*a + b*b - c*c ) / (2 * a * b ) );

}

double calc_deg(double x1,double y1,double x2,double y2,double x3,double y3){

    double x,y,z;

    x = dist(x1,y1,x2,y2);
    y = dist(x2,y2,x3,y3);
    z = dist(x3,y3,x1,y1); 

    return deg(x,y,z);

}


int main(){

    double x1,y1,x2,y2,x3,y3,x4,y4;
    char c;

    while(cin >> x1 >> c >> y1 >> c >> x2 >> c >> y2 >> c >> x3 >> c >> y3 >> c >> x4 >> c >> y4){

        double deg1,deg2,deg3,deg4;

        deg1 = calc_deg(x1,y1,x2,y2,x3,y3);
        deg2 = calc_deg(x2,y2,x3,y3,x4,y4);
        deg3 = calc_deg(x3,y3,x4,y4,x1,y1);
        deg4 = calc_deg(x4,y4,x1,y1,x2,y2);

        
        if(abs(deg1 + deg2 + deg3 + deg4 - 2*M_PI) < 0.00001){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }


    }





    return 0;

}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
char c;
double xa,ya,xb,yb,xc,yc,xd,yd,ab,bc,cd,da,aa,bb,cc,dd;
while(cin>>xa){
cin>>c>>ya>>c>>xb>>c>>yb>>c>>xc>>c>>yc>>c>>xd>>c>>yd;
ab=(xb-xa)*(yc-ya)-(yb-ya)*(xc-xa);
bc=(xc-xb)*(yd-yb)-(yc-yb)*(xd-xb);
cd=(xd-xc)*(ya-yc)-(yd-yc)*(xa-xc);
da=(xa-xd)*(yb-yd)-(ya-yd)*(xb-xd);
if(ab*bc<0||bc*cd<0||cd*da<0||da*ab<0)cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
return 0;
}

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

struct line{
	double gr,in;
	int dir;
	line(){}
	line(double gradient,double intercept,int direction){
		gr=gradient;
		in=intercept;
		dir=direction;
	}
};

struct point{
	double x,y;
	point(){}
	point(double xx,double yy){
		x=xx;
		y=yy;
	}
};


double x[4],y[4];

line make_line(int i,int j){
	if(x[i]==x[j]){
		return line(0.0,x[i],1);
	}
	line l;
	l.gr=(y[j]-y[i])/(x[j]-x[i]);
	l.in=y[i]-x[i]*l.gr;
	l.dir=0;
	return l;
}

point cross(line a,line b){
	if(a.dir==1)return point(a.in,b.gr*a.in+b.in);
	if(b.dir==1)return point(b.in,a.gr*b.in+a.in);
	point p;
	p.x=-(b.in-a.in)/(b.gr-a.gr);
	p.y=a.gr*p.x+a.in;
	return p;
}

bool check(line a,int i,int j){
	line b=make_line(i,j);
	point p=cross(a,b);
	//printf("%d %d %f %f\n",i,j,p.x,p.y);
	if(b.dir==1){
		if((p.y-y[i])*(p.y-y[j])>=0.0)return false;
	}else{
		if((p.x-x[i])*(p.x-x[j])>=0.0)return false;
	}
	return true;
}

int main(void){
	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])){
		bool flag=true;
		line l1=make_line(0,2),l2=make_line(1,3);
		if(!check(l1,1,3) || !check(l2,0,2))flag=false;
		printf("%s\n",flag?"YES":"NO");
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
int main()
{
	while (true)
	{
		double xa, ya, xb, yb, xc, yc, xd, yd;
		char foo;
		std::cin >> xa >> foo >> ya >> foo >> xb >> foo >> yb >> foo >> xc >> foo >> yc >> foo >> xd >> foo >> yd;
		if (std::cin.eof())
		{
			break;
		}
		const double A_C = hypot(xa - xc, ya - yc);
		const double B_D = hypot(xb - xd, yb - yd);
		const double AC_B = abs(((yc - ya)*(xb - xc) - (xc - xa)*(yb - yc)) / hypot(yc - ya, xc - xa));
		const double BD_A = abs(((yd - yb)*(xa - xd) - (xd - xb)*(ya - yd)) / hypot(yd - yb, xd - xb));
		std::cout << (A_C > BD_A&&B_D > AC_B ? "YES" : "NO") << std::endl;
	}
	return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){
	
	float xa,ya,xb,yb,xc,yc,xd,yd;
	
	while(scanf("%f,%f,%f,%f,%f,%f,%f,%f",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF){
		float a,b,c,d;
		
		//if(xb!=xa)
		a=(yb-ya)/(xb-xa);
		//if(xc!=xd)
		b=(yc-yd)/(xc-xd);
		//if(xc!=xb)
		c=(yc-yb)/(xc-xb);
		//if(xd!=xa)
		d=(yd-ya)/(xd-xa);
		
	
		if(abs(a)==abs(b)&&abs(c)==abs(d))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}

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[4],y[4],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.01)
            puts("YES");
        else
            puts("NO");
    }
    return 0;
}