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<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;

bool check(double x1, double y1, double x2, double y2){
  return x1 * y2 - y1 * x2 > 0;
}

int main(void) {

  vector<double> x(4);
  vector<double> 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 ){
    bool f = true;
    for(int i=0; i<4; i++){
      int j = i + 1;
      bool a = check(x[i%4]-x[(i+1)%4], y[i%4]-y[(i+1)%4], x[(i+1)%4]-x[(i+2)%4], y[(i+1)%4]-y[(i+2)%4]);
      bool b = check(x[j%4]-x[(j+1)%4], y[j%4]-y[(j+1)%4], x[(j+1)%4]-x[(j+2)%4], y[(j+1)%4]-y[(j+2)%4]);
      if( a != b ){
        f = false;
        break;
      }
    }
    cout << ( f ? "YES":"NO") << endl;
  }

  return 0;
}

// EOF

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define pb push_back
#define mp make_pair
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

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(a * x, a * y); }
	Point operator / (double a) { return Point(x / a, y / a); }

	double abs() { return sqrt(norm()); }
	double norm() { return x * x + y * y; }

	bool operator < (const Point &p) const {
		return x != p.x ? x < p.x : y < p.y;
	}

	bool operator == (const Point &p) const {
		return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
	}
};

typedef Point Vector;

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

double xa, ya, xb, yb, xc, yc, xd, yd;
char comma;

int main()
{
	while (cin>>xa>>comma>>ya>>comma>>xb>>comma>>yb>>comma>>xc>>comma>>yc>>comma>>xd>>comma>>yd)
	{
		Point a(xa, ya);
		Point b(xb, yb);
		Point c(xc, yc);
		Point d(xd, yd);

		Vector ab = b - a;
		Vector bc = c - b;
		Vector cd = d - c;
		Vector da = a - d;

		if (cross(ab, bc) > EPS)
		{
			//反時計回り
			if (cross(bc, cd) > EPS && cross(cd, da) > EPS && cross(da, ab) > EPS)
			{
				cout << "YES" << endl;
				continue;
			}
		} else if (cross(ab, bc) < -EPS) {
			//時計回り
			if (cross(bc, cd) < -EPS && cross(cd, da) < -EPS && cross(da, ab) < -EPS)
			{
				cout << "YES" << endl;
				continue;
			}
		}

		cout << "NO" << endl;
	}
	
	return 0;
}

C++: #include <cstdio>

using namespace std;

int side(double a, double b, double c, double d) {
  return a * d - b * c >= 0 ? 1 : -1;
}

int main() {
  double x[8], y[8];
  while (scanf("%lf,%lf", x, y) == 2) {
    for (int i = 1; i < 4; i++)
      scanf(",%lf,%lf", x+i, y+i);
    for (int i = 0; i < 4; i++)
      x[i+4] = x[i];
    int s = 0;
    for (int i = 0; i < 4; i++)
      s += side(x[i+1]-x[i], y[i+1]-y[i], x[i+2]-x[i+1], y[i+2]-y[i+1]);
    puts((s == 4 || s == -4) ? "YES" : "NO");
  }
  return 0;
}

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

#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define dle(a,b) (equals(a,b) || a<b)
static const double PI = M_PI;

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 k ) { return Point(k*x, k*y); }
  Point operator/ ( double k ) { return Point(x/k, y/k); }

  double abs() { return sqrt(norm()); }
  double norm() { return x*x+y*y; }

  bool operator< ( const Point &p ) const {
    return x != p.x ? x < p.x : y < p.y;
  }
  
  bool operator== (const Point &p) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

typedef Point Vector;

double norm( Vector a ) { return a.x*a.x + a.y*a.y; }
double abs( Vector a ) { return sqrt(norm(a)); }
Point polar( double a, double r ) { return Point(cos(r)*a, sin(r)*a); }
double getDist( Vector a, Vector b ) { return abs(a - b); }
double dot( Vector a, Vector b ) { return a.x*b.x + a.y*b.y; }
double cross( Vector a, Vector b ) { return a.x*b.y - a.y*b.x; }

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw( Point p0, Point p1, Point p2 ) {
  // about CCW
  // http://gihyo.jp/dev/serial/01/geometry/0006?page=2

  Vector a = p1 - p0;
  Vector b = p2 - p0;
  if( cross(a, b) > EPS ) return COUNTER_CLOCKWISE;
  if( cross(a, b) < -EPS ) return CLOCKWISE;
  if( dot(a, b) < -EPS ) return ONLINE_BACK;
  if( norm(a) < norm(b) ) return ONLINE_FRONT;
  return ON_SEGMENT;
}

bool isConvex( Point P[4] ) {
  int c = ccw(P[0], P[1], P[2]);
  for( int i = 1; i < 4; i++) {
    if( c!= ccw(P[i], P[(i+1)%4], P[(i+2)%4]) ) return false;
  }
  return true;
}

int main() {
  char ch;
  Point P[4];

  while( cin>>P[0].x>>ch>>P[0].y) {
    for(int i=1; i<4; i++) cin >> ch >> P[i].x >> ch >> P[i].y;
    if( isConvex(P) ) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  
  return 0;
}

C++: #include <stdio.h>

bool is_up(const float x1, const float y1,
			const float x2, const float y2,
			const float xp, const float yp){
	float y = 0.0;
	y = (y2 - y1)/(x2 - x1)*(xp - x1) + y1;
	return yp > y;
}

int main(void){
	float x[4];
	float y[4];
	while(scanf("%f,%f,%f,%f,%f,%f,%f,%f",
		x, y, x+1, y+1, x+2, y+2, x+3, y+3) != EOF){
		if(is_up(x[0], y[0], x[2], y[2], x[1], y[1]) ^
			is_up(x[0], y[0], x[2], y[2], x[3], y[3]) == 0){
			puts("NO");
		}else if(is_up(x[1], y[1], x[3], y[3], x[2], y[2]) ^
			is_up(x[1], y[1], x[3], y[3], x[0], y[0]) == 0){
			puts("NO");
		}else{
			puts("YES");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
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){
		if(x[0]==x[2]){
			if(x[0]<x[1]&&x[0]<x[3])
				cout<<"NO"<<endl;
			else if(x[0]>x[1]&&x[0]>x[3])
				cout<<"NO"<<endl;
		}
		else if(x[1]==x[3]){
			if(x[1]<x[0]&&x[1]<x[2])
				cout<<"NO"<<endl;
			else if(x[1]>x[0]&&x[1]>x[2])
				cout<<"NO"<<endl;
		}
		else {
			if(y[1]>((y[2]-y[0])/(x[2]-x[0]))*(x[1]-x[0])+y[0]&&y[3]>((y[2]-y[0])/(x[2]-x[0]))*(x[3]-x[0])+y[0])
			cout<<"NO"<<endl;
			else  if(y[1]<((y[2]-y[0])/(x[2]-x[0]))*(x[1]-x[0])+y[0]&&y[3]<((y[2]-y[0])/(x[2]-x[0]))*(x[3]-x[0])+y[0])
			cout<<"NO"<<endl;
			else if(y[0]>((y[3]-y[1])/(x[3]-x[1]))*(x[0]-x[1])+y[1]&&y[2]>((y[3]-y[1])/(x[3]-x[1]))*(x[2]-x[1])+y[1])
			cout<<"NO"<<endl;
			else if(y[0]<((y[3]-y[1])/(x[3]-x[1]))*(x[0]-x[1])+y[1]&&y[2]<((y[3]-y[1])/(x[3]-x[1]))*(x[2]-x[1])+y[1])
			cout<<"NO"<<endl;
			else cout<<"YES"<<endl;
		}
	}
	return 0;
}