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 <stdio.h>
using namespace std;

int main(){
	double xa,ya,xb,yb,xc,yc,xd,yd;
	double sab,sac,sbc,tab,tac,tbc;
	bool flag;
	
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
	&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF)
	{
		sab=(yb-ya)/(xb-xa);
		sac=(yc-ya)/(xc-xa);
		sbc=(yc-yb)/(xc-xb);
		
		tab=ya-sab*xa;
		tac=ya-sac*xa;
		tbc=yb-sbc*xb;
		
		if(ya>yc) flag=(sab*xd+tab-yd>0&&sac*xd+tac-yd<0&&sbc*xd+tbc-yd<0);
		else      flag=(sab*xd+tab-yd<0&&sac*xd+tac-yd<0&&sbc*xd+tbc-yd>0);
		
		cout<<(flag?"YES\n":"NO\n");
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <sstream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define bitcount(b) __builtin_popcount(b)
#define all(n) n.begin(),n.end()
typedef pair<double,double> P;
#define x first
#define y second

double tri(P a,P b, P c){
	a.x -= c.x, a.y -= c.y;
	b.x -= c.x, b.y -= c.y;
	c.x -= c.x, c.y -= c.y;
	
	return abs( a.x * b.y + b.y * a.x ) / 2.0;
}

int main(){
	vector<P> d(4);
	string line;
	while( getline(cin,line) ){
		while(~line.find(","))line[line.find(",")] = ' ';
		stringstream ss(line);
		rep(i,4)ss >> d[i].x >> d[i].y;
		
		double S = tri(d[0],d[2],d[1]) + tri(d[0],d[2],d[3]);
		
		bool flag = true;
		
		rep(i,4){
			double s = tri(d[0],d[2],d[1]) + tri(d[0],d[2],d[3]);
			
			if( s != S)flag = false;
			rotate(d.begin(),d.begin()+1,d.end());
		}
		cout << (flag?"YES":"NO") << endl;
	}
}

C++: #include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
// ------ Classes ------ //
class Point {
public:
	long double px, py;
	Point() : px(0), py(0) {};
	Point(long double px_, long double py_) : px(px_), py(py_) {};
	friend bool operator==(const Point& p1, const Point& p2) { return p1.px == p2.px && p1.py == p2.py; }
	friend bool operator!=(const Point& p1, const Point& p2) { return p1.px != p2.px || p1.py != p2.py; }
	friend Point operator+(const Point& p1, const Point& p2) { return Point(p1.px + p2.px, p1.py + p2.py); }
	friend Point operator-(const Point& p1, const Point& p2) { return Point(p1.px - p2.px, p1.py - p2.py); }
	friend Point operator*(const Point& p1, long double d) { return Point(p1.px * d, p1.py + d); }
	friend Point operator*(long double d, const Point& p1) { return p1 * d; }
	friend Point operator/(const Point& p1, long double d) { return Point(p1.px / d, p1.py / d); }
	Point& operator+=(const Point& p1) { px += p1.px; py += p1.py; return *this; }
	Point& operator-=(const Point& p1) { px -= p1.px; py -= p1.py; return *this; }
	Point& operator*=(long double d) { px *= d; py *= d; return *this; }
	Point& operator/=(long double d) { px /= d; py /= d; return *this; }
};
// ------ Functions ------ //
long double norm(const Point& a) { return a.px * a.px + a.py * a.py; }
long double abs(const Point& a) { return sqrtl(norm(a)); }
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
int ccw(Point p0, Point p1, Point p2) {
	Point a = p1 - p0, b = p2 - p0;
	if (crs(a, b) > 1e-10) return 1;
	if (crs(a, b) < -1e-10) return -1;
	if (dot(a, b) < -1e-10) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
// ------ Main ------ //
Point p1, p2, p3, p4; int r1, r2, r3, r4;
int main() {
	while (~scanf("%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf", &p1.px, &p1.py, &p2.px, &p2.py, &p3.px, &p3.py, &p4.px, &p4.py)) {
		r1 = ccw(p1, p2, p3);
		r2 = ccw(p2, p3, p4);
		r3 = ccw(p3, p4, p1);
		r4 = ccw(p4, p1, p2);
		printf("%s\n", (r1 == r2 && r2 == r3 && r3 == r4 && abs(r1) == 1) ? "YES" : "NO");
	}
	return 0;
}

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;

struct point{
	double x;
	double y;
};

int ccw(point p0, point p1, point p2){
	double dx1 = p1.x - p0.x, dy1 = p1.y - p0.y;
	double dx2 = p2.x - p0.x, dy2 = p2.y - p0.y;
	if(dy2 * dx1 > dy1 * dx2) return 1;
	else return -1;
}

int main(){
	point a, b, c, d;
	char ch;
	while(cin >> a.x >> ch >> a.y >> ch >> b.x >> ch >> b.y
		>> ch >> c.x >> ch >> c.y >> ch >> d.x >> ch >> d.y)
	{
		if((ccw(a,c,b) != ccw(a,c,d)) && (ccw(b,d,a) != ccw(b,d,c))){
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}