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 <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


inline double det(const P &a, const P &b) {
	return (conj(a) * b).imag();
}

int main() {
	double x[4], y[4];
	char c;
	for (; cin >> x[0] >> c >> y[0] ; ) {
		rep (i, 3) cin >> c >> x[i + 1] >> c >> y[i + 1];
		double a = 0, b = 0;
		double s = 0.0;
		rep (i, 4) s += fabs(det(P(x[i], y[i]), P(x[(i + 1) % 4], y[(i + 1) % 4]))) / 2.0;
		double sub_s = 0;
		rep(j, 4) {
			double ss = 0.0;
			rep(i, 4) if (i != j) {
				int idx = (i + 1) % 4;
				if(i + 1 == j) idx = (i + 2) % 4;
				ss += fabs(det(P(x[i], y[i]), P(x[idx], y[idx]))) / 2.0;
			}
			sub_s = max(sub_s, ss);
		}
		cout << (s >= sub_s ? "YES" : "NO") << endl;
	}
	return 0;
}

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

using namespace std;

class Vector{
public:
	double x,y;

	Vector(){}
	Vector( double dx, double dy ){
		x = dx;
		y = dy;
	}
	Vector operator-( const Vector& hoge ){
		return Vector( x - hoge.x, y - hoge.y );
	}

	Vector operator-( const Vector& hoge ) const{
		return Vector( x - hoge.x, y - hoge.y );
	}
};

double crossConduct( const Vector& lhs, const Vector& rhs )
{
	return lhs.x * rhs.y - lhs.y * rhs.x;
}

double line( const Vector& a, const Vector& b, const Vector& p )
{
	Vector hoge = b - a;
	Vector piyo = p - a;

	return crossConduct( hoge, piyo );
}

int main(int argc, char const* argv[])
{
	Vector A,B,C,D;
	char comma;

	while( cin >> A.x >> comma >> A.y >> comma >> B.x >> comma >> B.y >> comma >> C.x >> comma >> C.y >> comma >> D.x >> comma >> D.y ){
		double a,b,c,d;
		a = line( A, B, C );
		b = line( B, C, D );
		c = line( C, D, A );
		d = line( D, A, B );
		if( ( a > 0 && b > 0 && c > 0 && d > 0 ) || ( a < 0 && b < 0 && c < 0 && d < 0 ) ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;


}

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

using namespace std;

#define EPS 1e-5

struct point{
	double x;
	double y;
};

struct line{
	double a; // 傾き
	double b; // y切片
};

istream& operator >> ( istream& s , point& p );
bool get_line( const point& a , const point& b , line *a_b );
bool get_position( const point& a , const point& b , const point& c );
bool get_cross( const point& a , const point& b , const point& c , const point& d );
bool get_convex( const point& a , const point& b , const point& c , const point& d );
bool get_convex_new( const point& a , const point& b , const point& c , const point& d );

int main(void)
{
	point a, b, c, d;
	char comma;

	while(1)
	{
		cin >> a >> comma >> b >> comma >> c >> comma >> d;
		if( cin.eof() ) break;
		if( get_convex_new( a , b , c , d ) ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

istream& operator >> ( istream& s , point& p )
{
	char c;
	return s >> p.x >> c >> p.y;
}

bool get_line( const point& a , const point& b , line *a_b )
{
	if( fabs(a.x - b.x) < EPS ) return false;
	else{
		a_b->a = (a.y - b.y)/(a.x - b.x);
		a_b->b = a.y - (a.x * a_b->a);
		return true;
	}
}

bool get_position( const point& a , const point& b , const point& c )
{
	// 点a, bを通る直線に対する点cの位置を返す。(右、上：ture)

	line a_b;

	bool result = get_line( a , b , &a_b );
	if( result == false ){
		if( c.x > a.x ) return true;
		else return false;
	}
	else{
		if( c.y > a_b.a * c.x + a_b.b ) return true;
		else return false;
	}
}

bool get_cross( const point& a , const point& b , const point& c , const point& d )
{
	// 点a, cを結ぶ線分と、点b, dを通る直線とが交わればtrueを返す。

	bool result_ac_b = get_position( a , c , b );
	bool result_ac_d = get_position( a , c , d );
	if( result_ac_b == result_ac_d ) return false;
	else return true;
}

bool get_convex( const point& a , const point& b , const point& c , const point& d )
{
	// 点a, b, c, dの順に結んだ時にできる四角形が凸であればtrueを返す。

	bool result_ac_bd = get_cross( a , b , c , d ); // 線分acと直線bdの交差判定
	bool result_bd_ac = get_cross( b , a , d , c ); // 線分bdと直線acの交差判定

	if( result_ac_bd == true && result_bd_ac == true ) return true;
	else return false;
}

bool get_convex_new( const point& a , const point& b , const point& c , const point& d )
{
	bool result_ac_bd;
	bool result_bd_ac;

	if( get_position( a , c , b ) != get_position( a , c , d ) ) result_ac_bd = true;
	else result_ac_bd = false;

	if( get_position( b , d , a ) != get_position( b , d , c ) ) result_bd_ac = true;
	else result_bd_ac = false;

	if( result_ac_bd == true && result_bd_ac == true ) return true;
	else return false;
}

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

int main()
{
	const double PI = acos(-1);
	double x[4], y[4];
	char c;

	while (cin >> x[0] >> c >> y[0] >> c >> x[1] >> c >> y[1] >> c
				>> x[2] >> c >> y[2] >> c >> x[3] >> c >> y[3]) {

		bool f = 1;
		int s = 0;

		double t = atan2(y[2] - y[1], x[2] - x[1]) - atan2(y[1] - y[0], x[1] - x[0]);

		if (t > 0)
			s = 1;

		for (int i = 1; i < 4; i++) {
			int j = (i + 1) % 4, k = (i + 2) % 4;
			t = atan2(y[k] - y[j], x[k] - x[j]) - atan2(y[j] - y[i], x[j] - x[i]);

			if (t < -PI)
				t += PI * 2;
			else if (t > PI)
				t -= PI * 2;

			if (!((s == 1 && t > 0) || (s == 0 && t < 0))) {
				f = 0;
				break;
			}
		}

		if (f)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

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

typedef complex<double> P;

// ?¨±?????????????????
#define EPS (1e-10)
// 2??????????????????????????????????????????
#define EQ(a,b) (abs((a)-(b)) < EPS)
// 2??????????????????????????????????????????
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

// ?????? (cross product) : a??b = |a||b|sin??
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
// ????§???¢(v1,v2,v3)????????????v?????????????????????
bool inTriangle(P v1,P v2,P v3,P v){
	if(cross(v2-v1,v-v1)<-EPS&&cross(v3-v2,v-v2)<-EPS&&cross(v1-v3,v-v3)<-EPS)return true;
	else if(cross(v2-v1,v-v1)>EPS&&cross(v3-v2,v-v2)>EPS&&cross(v1-v3,v-v3)>EPS)return true;
	return false;
}

P data[4];
bool input(){
	char c;
	
	for(int i=0;i<4;i++){
		if(!(cin>>data[i].real()))return false;
		cin>>c;
		cin>>data[i].imag();
		if(i<3)cin>>c;
	}
	return true;
}
int n[4]={0,1,2,3};
int main(){
	while(input()){
		do{
			if(inTriangle(data[n[0]],data[n[1]],data[n[2]],data[n[3]])){
				cout<<"NO"<<endl;
				return 0;
			}
		}while(next_permutation(n,n+4));
		cout<<"YES"<<endl;
	}
	
}