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++: import java.util.*;

public class Main{
	
	private static final Scanner scan = new Scanner(System.in)
							.useDelimiter("[,\\s]+");

	public static void main(String[] args){

		while(scan.hasNext()){
			double[] x = new double[4];
			double[] y = new double[4];
			for(int i = 0; i < 4; i++){
				x[i] = scan.nextDouble();
				y[i] = scan.nextDouble();
			}
			boolean flag = isIntersect(x[0], y[0], x[2], y[2], x[1], y[1], x[3], y[3])
					&& isIntersect(x[1], y[1], x[3], y[3], x[0], y[0], x[2], y[2]);
			System.out.printf("%s\n", flag? "Yes" : "NO");
		}
	}

	public static boolean isIntersect(double x1, double y1, double x2, double y2,
								 double x3, double y3, double x4, double y4){
		//???A(x1,y1)??¨???B(x2,y2)????????¶??´?????¨???C(x3,y3)??¨???D(x4,y4)????????¶???????????????????????????????????????
		double ta = (y3-y1)*(x1-x2) + (x1-x3)*(y1-y2);
		double tb = (y4-y1)*(x1-x2) + (x1-x4)*(y1-y2);
		return ta * tb < 0;
	}
}

C++: #include<string>
#include<vector>
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)


int main(){

	while(true){

		double xa,ya,xb,yb,xc,yc,xd,yd;
		cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
		if(cin.fail()) break;

		double a1=ya-yc;
		double b1=xc-xa;
		double c1=ya*(xa-xc)-xa*(ya-yc);
		double a2=yb-yd;
		double b2=xd-xb;
		double c2=yb*(xb-xd)-xb*(yb-yd);

		if((a1*xb+b1*yb+c1)*(a1*xd+b1*yd+c1)>0 && (a2*xa+b2*ya+c2)*(a2*xc+b2*yc+c2)<0) cout << "NO" << endl;
		else if((a1*xb+b1*yb+c1)*(a1*xd+b1*yd+c1)<0 && (a2*xa+b2*ya+c2)*(a2*xc+b2*yc+c2)>0) cout << "NO" << endl;
		else if((a1*xb+b1*yb+c1)*(a1*xd+b1*yd+c1)<0 && (a2*xa+b2*ya+c2)*(a2*xc+b2*yc+c2)<0) cout << "YES" << endl;

	}

	return 0;
}

C++: #include<iostream>
#include<complex>
#include<vector>
using namespace std;
typedef complex < double > P;
typedef vector< P > G;
struct L:public vector< P >{ // L:線分
  L(const P& a,const P& b){push_back(a);push_back(b);}
};
const double EPS = 1e-8;
const double INF = 1e12;
double cross(const P& a,const P& b){
  return imag(conj(a) * b);
}
double dot(const P& a,const P& b){
  return real(conj(a) * b);
}
int ccw(P a,P b,P c){
  b -= a; c -= a;
  if(cross(b,c) > 0) return 1;
  if(cross(b,c) < 0) return -1;
  if(dot(b,c) < 0) return 2; // c--a--b
  if(norm(b) < norm(c)) return -2; // a--b--c
  return 0; // a--c--b
}
bool intersect(const L& s,const L& t){
  return ccw(s[0],s[1],t[0]) * ccw(s[0],s[1],t[1]) <= 0 &&
    ccw(t[0],t[1],s[0]) * ccw(t[0],t[1],s[1]) <= 0;
}
bool isconvex(const G& g){
  return intersect(L(g[0],g[2]),L(g[1],g[3]));
}
int main(){
  double x1,y1,x2,y2,x3,y3,x4,y4;
  char o;
  while(cin >> x1 >> o >> y1 >> o >> x2 >> o >> y2 >> o >> x3 >> o >> y3 >> o >> x4 >> o >> y4){
    G g(4);
    g[0] = P(x1,y1);
    g[1] = P(x2,y2);
    g[2] = P(x3,y3);
    g[3] = P(x4,y4);
    cout << (isconvex(g) ? "YES" : "NO") << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
#include <map>
#include <vector>
#include <stack>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

typedef struct P {
    double x;
    double y;
} P;

double isCross(P a, P b, P c, P d)
{
    return ((a.x - b.x)*(c.y - a.y) + (a.y - b.y)*(a.x - c.x)) * ((a.x - b.x)*(d.y - a.y) + (a.y - b.y)*(a.x - d.x));
}

int main(void)
{
    double xa,xb,xc,xd,ya,yb,yc,yd;
    
    while (~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd)) {
        P a = {xa, ya};
        P b = {xb, yb};
        P c = {xc, yc};
        P d = {xd, yd};
        if (isCross(a, b, c, d) > 0.0 && isCross(c, d, a, b) > 0.0) {
            cout << "YES" << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }
    
    return 0;
}

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

int main(void) {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  bool check;
  int BABC, CACD, DADB, CBCD, DBDA, ABAC, DCDA, ACAB, BCBD, ADAB, BDBC, CDCA;
  
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF) {
    check = false;
    // AがBCDの内部にあるかどうかを調べる。
    BABC = (ya - yb)*(xc - xb) - (yc - yb)*(xa - xb);
    CACD = (ya - yc)*(xd - xc) - (yd - yc)*(xa - xc);
    DADB = (ya - yd)*(xb - xd) - (yb - yd)*(xa - xd);
    if((BABC > 0 && CACD > 0 && DADB > 0) || (BABC < 0 && CACD < 0 && DADB < 0)) {
      check = true;
    }
    // BがCDAの内部にあるかどうかを調べる。
    CBCD = (yb - yc)*(xd - xc) - (yd - yc)*(xb - xc);
    DBDA = (yb - yd)*(xa - xd) - (ya - xd)*(xb - xd);
    ABAC = (yb - ya)*(xc - xa) - (yc - ya)*(xb - xa);
    if((CBCD > 0 && DBDA > 0 && ABAC > 0) || (CBCD < 0 && DBDA < 0 && ABAC < 0)) {
      check = true;
    }
    // CがDABの内部にあるかどうかを調べる。
    DCDA = (yc - yd)*(xa - xd) - (ya - yd)*(xc - xd);
    ACAB = (yc - ya)*(xb - xa) - (yb - ya)*(xc - xa);
    BCBD = (yc - yb)*(xd - xb) - (yd - yb)*(xc - xb);
    if((DCDA > 0 && ACAB > 0 && BCBD > 0) || (DCDA < 0 && ACAB < 0 && BCBD < 0)) {
      check = true;
    }
    // DがABCの内部にあるかどうか調べる。
    ADAB = (yd - ya)*(xb - xa) - (yb - ya)*(xd - xa);
    BDBC = (yd - yb)*(xc - xb) - (yc - yb)*(xd - xb);
    CDCA = (yd - yc)*(xa - xc) - (ya - yc)*(xd - xc);
    if((ADAB > 0 && BDBC > 0 && CDCA > 0) || (ADAB < 0 && BDBC < 0 && CDCA < 0)) {
      check = true;
    }
    
    if(check) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}

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)%4] - p[(i+1)%4];
            Point p2 = p[i] - p[(i+1)%4];
            if(p1.cross(p2) < 0)
                plus = false;
            else
                minus = false;
        }
        if(plus || minus)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
}