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>

using namespace std;

struct Vector {
        double x;
        double y;
};

bool is_convex(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) {
    Vector ab = Vector{xb - xa, yb - ya};
    Vector bc = Vector{xc - xb, yc - yb};

    Vector bd = Vector{xd - xb, yd - yb};
    Vector dc = Vector{xc - xd, yc - yd};

    Vector da = Vector{xa - xd, ya - yd};
    Vector ac = Vector{xc - xa, yc - ya};

    double cross_product_1 = ab.x * bc.y - ab.y * bc.x;
    double cross_product_2 = bd.x * dc.y - bd.y * dc.x;
    double cross_product_3 = da.x * ac.y - da.y * ac.x;

    return (cross_product_1 >=  0 && cross_product_2 >=  0 && cross_product_3 >=  0) ||
            (cross_product_1 <  0 || cross_product_2 <  0 && cross_product_3 <  0);
}

int main() {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    string result;

    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF) {
        if(is_convex( xa, ya, xb, yb, xc, yc, xd, yd)) {
            result = "NO";
        } else {
            result = "YES";
        }
        cout << result << endl;
    }
    return 0;
}

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

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(x*a, y*a); }
};

typedef Point Vector;

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

int main() {
  Point p[4];
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
	      &p[0].x, &p[0].y, &p[1].x, &p[1].y,
	      &p[2].x, &p[2].y, &p[3].x, &p[3].y) != EOF) {

    bool okFlag = true;
    for(int i = 0; i < 4; i++) {
      int idx1, idx2, idx3;
      idx1 = (i+1)%4;
      idx2 = (i+2)%4;
      idx3 = (i+3)%4;
      if(cross(p[idx1]-p[i], p[idx2]-p[i])
	 *cross(p[idx2]-p[i], p[idx3]-p[i]) < 0) {
	okFlag = false;
	break;
      }
    }

    if(okFlag) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

class Point{
public:
    double y, x;
    Point(double y0, double x0){
        y = y0;
        x = x0;
    }
    Point(){
        y = x = 0.0;
    }
    double cross(const Point& p) const{
        return x * p.y - y * p.x;
    }
    Point operator-(const Point& p) const{
        return Point(y - p.y, x - p.x);
    }
};

int main()
{
    for(;;){
        vector<Point> p(4);
        for(int i=0; i<4; ++i){
            char c;
            if(!(cin >> p[i].x >> c >> p[i].y))
                return 0;
            if(i < 3)
                cin >> c;
        }

        bool plus = true;
        bool minus = true;
        for(int i=0; i<4; ++i){
            Point p1 = p[(i+2)%3] - p[(i+1)%3];
            Point p2 = p[(i+1)%3] - p[i];
            if(p1.cross(p2) < 0)
                plus = false;
            else
                minus = false;
        }
        if(plus != minus)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
}

C++: #include <iostream>

class Point
{
public:
	double m_X;
	double m_Y;

	Point(double x, double y)
		: m_X( x )
		, m_Y( y )
	{}
	~Point() {}
	double DiffX(const Point& rhs) const
	{
		return(rhs.m_X - m_X);
	}

	double DiffY(const Point& rhs) const
	{
		return(rhs.m_Y - m_Y);
	}
};

class Vec
{
	double m_X;
	double m_Y;

public:
	Vec(Point start, Point end)
		: m_X(end.m_X - start.m_X)
		, m_Y(end.m_Y - start.m_Y)
	{
	}
	~Vec() {}

	double CrossProduct(const Vec& rhs)
	{
		return(m_X*rhs.m_Y - m_Y*rhs.m_X);
	}
};

int main()
{
	double ax, ay, bx, by, cx, cy, dx, dy;
	char s;
	while (std::cin >> ax >> s >> ay >> s >> bx >> s >> by >> s >> cx >> s >> cy >> s >> dx >> s >> dy)
	{
		Point a(ax, ay);
		Point b(bx, by);
		Point c(cx, cy);
		Point d(dx, dy);

		Vec ab(a, b);
		Vec bc(b, c);
		Vec cd(c, d);
		Vec da(d, a);

		double cp_ab = ab.CrossProduct(bc);
		double cp_bc = bc.CrossProduct(cd);
		double cp_cd = cd.CrossProduct(da);
		double cp_da = da.CrossProduct(ab);

		if ( (cp_ab > 0 && cp_bc > 0 && cp_cd > 0 && cp_da > 0) || ((cp_ab < 0 && cp_bc < 0 && cp_cd < 0 && cp_da < 0)) )
		{
			std::cout << "YES" << std::endl;
		}
		else
		{
			std::cout << "NO" << std::endl;
		}
	}

	return 0;
}

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

vector<pair<int,int> >vec;

int main(){
    double x[4],y[4];
    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){
        int suc=1;
        for(int i=0;i<4;i++){
            if((x[i]*y[(i+1)%4]-y[i]*x[(i+1)%4])*(x[(i+1)%4]*y[(i+2)%4]-y[(i+1)%4]*x[(i+2)%4])<=0){
           //     cout<<(x[i]*y[(i+1)%4]-y[i]*x[(i+1)%4])<<"     "<<(x[(i+1)%4]*y[(i+2)%4]-y[(i+1)%4]*x[(i+2)%4])<<endl;
                suc=0;
                break;
            }
          //  cout<<(x[i]*y[(i+1)%4])<<"    "<<(y[i]*x[(i+1)%4])<<"     "<<(x[(i+1)%4]*y[(i+2)%4])<<"    "<<(y[(i+1)%4]*x[(i+2)%4])<<endl;
        }
        if(suc)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}

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

struct Vector{
	double x;
	double y;
};

double gaiseki(Vector* a , Vector* 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){
		Vector ab , bc , ac , da , bd , dc;
		ab.x=xb-xa;
		ab.y=yb-ya;
		bc.x=xc-xb;
		bc.y=yc-yb;
		ac.x=xc-xa;
		ac.y=yc-ya;
		da.x=xa-xd;
		da.y=ya-yd;
		bd.x=xd-xb;
		bd.y=xd-xb;
		dc.x=xc-xd;
		dc.y=yc-yd;
		double abac , bdbc , dadc;
		abac=gaiseki(&ab , &ac);
		bdbc=gaiseki(&bd , &bc);
		dadc=gaiseki(&da , &dc);
		if((abac<0 && bdbc<0 && dadc<0)||(abac>0 && bdbc>0 && dadc>0 )) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0; 
}

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

using namespace std;

int main () {
	double xa, ya, xb, yb, xc, yc, xd, yd, xe, ye;
	double tac, tbd, sac, sbd;
	char c[10000];
	int i;
	while(scanf("%s",&c)!=EOF) {
		xa=atof(strtok ( c, "," ));
		ya = atof ( strtok ( NULL, "," ) ); 
		xb = atof ( strtok ( NULL, "," ) ); 
		yb = atof ( strtok ( NULL, "," ) ); 
		xc = atof ( strtok ( NULL, "," ) ); 
		yc = atof ( strtok ( NULL, "," ) ); 
		xd = atof ( strtok ( NULL, "," ) ); 
		yd = atof ( strtok ( NULL, "," ) ); 
		sac = ( yc - ya ) / ( xc - xa );
		tac = ya - xa*sac;
		sbd = ( yd - yb ) / ( xd - xb );
		tbd = yb - xb*sbd;
		xe = ( tac - tbd ) / ( sbd - sac );
		ye = xe*sac + tac;
		if(( ( xa <= xe&&xe <= xc ) || ( xc <= xe&&xe <= xa ) ) && ( ( ya <= ye&&ye <= yc ) || ( yc <= ye&&ye <= ya ) )) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
		//printf ( "%f %f\n", xb, yb );
	}
	return 0;
}