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

using namespace std;

double sinvalue( double v1x, double v1y, double v2x, double v2y )
{

	return ( v1x*v2y - v1y * v2x ) / sqrt( v1x * v1x + v1y * v1y ) * sqrt( v2x * v2x + v2y * v2y );
}


int main()
{
	double ax, ay, bx, by, cx, cy, dx, dy;
	double vecx_ab, vecy_ab, vecx_bc, vecy_bc, vecx_cd, vecy_cd, vecx_da, vecy_da;
	double sindab, sinabc, sinbcd, sincda;
	char tmp;
	while ( cin >> ax >> tmp >> ay >> tmp >> bx >> tmp >> by >> tmp >> cx >> tmp >> cy >> tmp >> dx >> tmp >> dy )
	{
		vecx_ab = bx - ax; vecy_ab = by - ay;
		vecx_bc = cx - bx; vecy_bc = cy - by;
		vecx_cd = dx - cy; vecy_cd = dy - cy;
		vecx_da = ax - dy; vecy_da = ay - dy;

		sindab = sinvalue( vecx_ab, vecy_ab, -vecx_da, -vecy_da );
		sinabc = sinvalue( vecx_bc, vecy_bc, -vecx_ab, -vecy_ab );
		sinbcd = sinvalue( vecx_cd, vecy_cd, -vecx_bc, -vecy_bc );
		sincda = sinvalue( vecx_da, vecy_da, -vecx_cd, -vecy_cd );

		if ( sindab > 0 && sinabc > 0 && sinbcd > 0 && sincda > 0 )
		{
			cout << "YES" << endl;
		}
		else 
		{
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <complex>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef complex<double> p;
typedef pair<int, int> pii;
typedef long long ll;

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

string solve(vector<p> vc){

	bool sgo;
	
	for(int i=0; i<vc.size(); ++i){
		
		bool sg = cross(vc[i] - vc[(i+2)%vc.size()], vc[(i+1)%vc.size()] - vc[(i+2)%vc.size()]) > 0;
		
		if(i==0){
			sgo = sg;
			continue;
		}
		
		if(sgo ^ sg)
			return "NO";
	}
	
	return "YES";
}
	

int main(){

	double x[4], y[4];
	char c;
	vector<p> lct;
	
	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], !cin.eof()){
			
		for(int i=0; i<4; ++i){
			lct.push_back(p(x[i]+100.0, y[i]+100.0));
		}
		
		cout << solve(lct) << endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<math.h>

#define PI 3.14159265358979

using namespace std;

double cos(double x1, double y1, double x2, double y2,double x3, double y3)
{
	double xa,xb,ya,yb;
	xa=x2-x1;
	ya=y2-y1;
	xb=x2-x3;
	yb=y2-y3;
	return (xa*xb+ya*yb)/(sqrt(xa*xa+ya*ya)*sqrt(xb*xb+yb*yb));
}

int main(void)
{
	double xa,ya,xb,yb,xc,yc,xd,yd,theta;
	char c;
	while(cin>>xa>>c>>ya>>c>>xb>>c>>yb>>c>>xc>>c>>yc>>c>>xd>>c>>yd)
	{
		theta=0;
		theta+=acos(cos(xa,ya,xb,yb,xc,yc));
		theta+=acos(cos(xb,yb,xc,yc,xd,yd));
		theta+=acos(cos(xc,yc,xd,yd,xa,ya));
		theta+=acos(cos(xd,yd,xa,ya,xb,yb));
		if(theta<2*PI)
		{
			cout<<"NO"<<endl;
		}
		else
		{
			cout<<"YES"<<endl;
		}
	}
}

C++: #include<iostream>

using namespace std;

int main(){

	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd){

		double a=(xc-xa)*(yd-ya)-(yc-ya)*(xd-xa);
		double b=(xc-xa)*(yb-ya)-(yc-ya)*(xb-xa);
		double c=(xd-xb)*(ya-yb)-(yd-yb)*(xa-xb);
		double d=(xd-xb)*(yc-yb)-(yd-yb)*(xc-xb);


		if(a*b<=0.0 && c*d<=0.0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

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

// ?????§?¨?????????¨??????
typedef complex<double> P;

//XY??§?¨?
#define X real()
#define Y imag()

// ??´???p1,p2??¨??????p3,p4???????????????
// (n < 0)<=>?????? , (n == 0)<=>??´??????, (n > 0)<=>?????????????????????  
double isIntersect(P p1, P p2, P p3, P p4){  
    return ( (p1.X-p2.X)*(p3.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p3.X)) * ((p1.X-p2.X)*(p4.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p4.X));  
}

int main(){
	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) != EOF ){
		P a( xa , ya );
		P b( xb , yb );
		P c( xc , yc );
		P d( xd , yd );
		
		if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){
			printf("NO\n");
		}else{
			printf("YES\n");
		}
	}
}

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

typedef complex<double> P;

// ?¨±?????????????????
#define EPS (1e-5)
// 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;
	}
	
}