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 <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>

using namespace std;

double EPS = 1e-10;

//誤差を考慮して足し算を行う
double add(double a, double b) {
	if( abs(a + b) < EPS * (abs(a) + abs(b))) {
		return 0;
	}

	return a + b;
}

//二次元ベクトル構造体
struct P {
	double x, y;

	P() {}
	P(double x, double y) : x(x), y(y) {
	}
	P operator + (P p) {
		return P(add(x, p.x), add(y, p.y));
	}
	P operator - (P p) {
		return P(add(x, -p.x), add(y, -p.y));
	}
	P operator * (double d) {
		return P(x * d, y * d);
	}
	double dot(P p) {	//　内積
		return add(x * p.x, y * p.y);
	}
	double det(P p) {	//　外積
		return add(x * p.y, -y * p.x);
	}
};

//　線分p1-p2上に点qがあるか判定
bool on_seg(P p1, P p2, P q) {
		return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0;
}

//　直線p1-p2と直線q1-q2の交点
P intersection(P p1, P p2, P q1, P q2) {
	return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}

int ccw(P a, P b, P c) {
	a = b - a;
	b = b - c;

	if(a.det(b) < 0) {
		return -1;
	} else if(a.det(b) > 0) {
		return 1;
	} else if(a.det(b) == 0) {
		return 0;
	}
}


int main() {

	P a, b, c, d;
	char dummy;

	while ( cin >> a.x >> dummy >> a.y >> dummy >> b.x >> dummy >> dummy >> b.y >> dummy >> c.x >> dummy >> c.y >> dummy >> d.x >> dummy >> d.y ) {
		int count = 0, ans = 0;
		count += ccw(a, b, c);
		ans += abs(ccw(a, b, c));
		count += ccw(b, c, d);
		ans += abs(ccw(b, c, d));
		count += ccw(c, d, a);
		ans += abs(ccw(c, d, a));
		count += ccw(d, a, b);
		ans += abs(ccw(d, a, b));

		if(abs(count) == ans) {
			cout << "YES" << endl;
		} else {
			cout << "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; }
};
class Segment {
public:
	Point p1, p2;
	Segment(Point p1_, Point p2_) : p1(p1_), p2(p2_) {};
	Segment(long double p1x, long double p1y, long double p2x, long double p2y) : p1(Point(p1x, p1y)), p2(Point(p2x, p2y)) {};
	friend bool operator==(const Segment& s1, const Segment& s2) { return (s1.p1 == s2.p1 && s1.p2 == s2.p2) || (s1.p1 == s2.p2 && s1.p2 == s2.p1); }
	friend bool operator!=(const Segment& s1, const Segment& s2) { return !(s1 == s2); }
};
class Line {
public:
	Point p1, p2;
	Line(Point p1_, Point p2_) : p1(p1_), p2(p2_) {};
	Line(long double p1x, long double p1y, long double p2x, long double p2y) : p1(Point(p1x, p1y)), p2(Point(p2x, p2y)) {};
	friend bool operator==(const Line& s1, const Line& s2) { return (s1.p1 == s2.p1 && s1.p2 == s2.p2) || (s1.p1 == s2.p2 && s1.p2 == s2.p1); }
	friend bool operator!=(const Line& s1, const Line& s2) { return !(s1 == s2); }
};
// ------ 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>
#include <cmath>
using namespace std;
const double EPS = 1e-9; const double INF = 1e10; const double PI = M_PI;
struct Point{
  Point(double x, double y ):x(x), y(y){}
  Point(){}
  double x,y;
};
Point operator+(const Point &a, const Point &b){ return Point(a.x + b.x, a.y + b.y); }
Point operator-(const Point &a, const Point &b){ return Point(a.x - b.x, a.y - b.y); }
double cross( const Point &a, const Point &b ){ return a.x * b.y - a.y * b.x; }
double dot(const Point &a, const Point &b){ return a.x * b.x + a.y * b.y; }
double norm( const Point &a ) { return dot( a, a ) ; }
int ccw( Point a, Point b, Point c ) {
  b = b - a;
  c = c - a;
  if ( cross( b, c ) > EPS ) return 1;
  if ( cross( b, c ) < -EPS ) return -1;
  return 0;
}
int main () {

  double xa, ya, xb, yb, xc, yc, xd, yd;
  char ch;
  while(cin >> xa >> ch >> ya >> ch >> xb >> ch >> yb >> ch >> xc >> ch >> yc >> ch >> xd >> ch >> yd){
    Point points[4] = {};

    points[0] = Point(xa, ya);
    points[1] = Point(xb, yb);
    points[2] = Point(xc, yc);
    points[3] = Point(xd, yd);
    
    bool same = true;
    bool already = false;
    int sign = 0;
    for(int i = 0; i < 4; i++){
      const int next = (i + 1) % 4;
      const int nnext = (next + 1) % 4;
      
      //cout << points[i].x << "," << points[i].y  << endl;
      if(!already){
	sign = ccw(points[i], points[next], points[nnext]);
	already = true;
      }else if(sign != ccw(points[i], points[next], points[nnext])){
	same = false;
	break;
      }
    }
    cout << (same ? "YES" : "NO") << endl;
  }

  return 0;

}