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 <algorithm>
#include <complex>
#include <cstdio>
#define EPS 1e-10
#define EQ(a,b) (abs(a - b) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))
using namespace std;

typedef complex<double> P;

double cross (P a, P b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

int is_intersected_ls(P a1, P a2, P b1, P b2) {
    return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
        ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}

int main ()
{
    double ax, ay, bx, by, cx, cy, dx, dy;
    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &ax, &ay, &bx, &by, &cx, &cy, &dx, &dy) != EOF) {
        P a = P(ax, by);
        P b = P(bx, by);
	P c = P(cx, cy);
        P d = P(dx, dy);

        if (EQ(is_intersected_ls(a, c, d, b), 0.0)) cout << "NO" << endl;
        else cout << "YES" << endl;
    }

    return 0;
}

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

using namespace std;

int main(void){
  double x[4], y[4];
  double p[4];
  
  while (scanf("%lf,%lf,", &x[0], &y[0])>0){
    scanf("%lf,%lf,%lf,%lf,%lf,%lf", &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]);
    for (int i=0; i<4; i++){
      int j=(i+1)%4;
      int k=(i+2)%4;
      p[i] = (x[j]-x[i])*(y[k]-y[j])-(x[k]-x[j])*(y[j]-y[i]);
      //printf("%lf\n", p[i]);
    }
    puts(p[0]*p[1]<0||p[1]*p[2]<0||p[2]*p[3]<0||p[3]*p[0]<0 ? "NO": "YES");
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
  double x1,x2,x3,x4,y1,y2,y3,y4;
  char d;

  while(cin>>x1>>d>>y1>>d>>x2>>d>>y2>>d>>x3>>d>>y3>>d>>x4>>d>>y4!='\0'){

    int a=0,b=0;
    int han=0;

    if(y2>(x2-x1)*(y3-y1)/(x3-x1)+y1)
      a=1;
    if(y4>(x4-x1)*(y3-y1)/(x3-x1)+y1)
      b=1;
    if(a==b)
      han=1;

    a=b=0;

    if(y1>(x1-x2)*(y4-y2)/(x4-x2)+y2)
      a=1;
    if(y3>(x3-x2)*(y4-y2)/(x4-x2)+y2)
      b=1;
    if(a==b)
      han=1;

    if(han==0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;

  }

}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
typedef complex<double> P;

char c;
double x,y,xx,yy,xxx,yyy,xxxx,yyyy;

double cr(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}

int main(){
	while(cin>>x>>c>>y>>c>>xx>>c>>yy>>c>>xxx>>c>>yyy>>c>>xxxx>>c>>yyyy){
		P a=P(x,y),b=P(xx,yy),c=P(xxx,yyy),d=P(xxxx,yyyy);
		int C=cr(d-a,b-a)>0&&cr(a-b,c-b)>0&&cr(b-c,d-c)>0&&cr(c-d,a-d)>0||cr(d-a,b-a)<0&&cr(a-b,c-b)<0&&cr(b-c,d-c)<0&&cr(c-d,a-d)<0;
		cout<<(C?"YES":"NO")<<endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#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) + pow(y1-y2, 2));
}

// 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);

        if(s1+s2 == s3+s4)
            puts("YES");
        else
            puts("NO");
    }
    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 = false;
        bool minus = false;
        for(int i=0; i<4; ++i){
            Point p1 = p[(i+1)%3] - p[i];
            Point p2 = p[(i+2)%3] - p[i];
            if(p1.cross(p2) < 0)
                minus = true;
            else
                plus = true;
        }
        if(plus != minus)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
}

C++: #include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;

const double EPS = 1e-12;

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);
	}

	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);
	}
};

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

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

// 2直線の直行判定
bool line_orth(P a1, P a2, P b1, P b2) {
	return fabs((a1 - a2).dot(b1 - b2)) < EPS;
}

// 2直線の平行判定
bool line_paral(P a1, P a2, P b1, P b2) {
	return fabs((a1 - a2).det(b1 - b2)) < EPS;
}

int main(void) {
	string str;
	P p[4];
	while (getline(cin, str)) {
		replace(str.begin(), str.end(), ',', ' ');
		stringstream buf(str);
		for (int i = 0; i < 4; i++) {
			buf >> p[i].x >> p[i].y;
		}

		bool modify = (p[3] - p[0]).det(p[0] - p[1]) < 0;
		bool flg = true;
		for (int i = 0; i < 3; i++) {
			if ((p[i] - p[i+1]).det(p[i+1] - p[(i+2)%4]) < 0 != modify){
				flg = false;
				break;
			}
		}
		cout << (flg ? "YES" : "NO") << endl;
	}
}