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<cstdlib>
#include<cmath>
#include<vector>

#define curr(P, i) P[(i) % P.size()]
#define next(P, i) P[(i+1) % P.size()]
#define prev(P, i) P[(i+P.size()-1) % P.size()]
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)

using namespace std;

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

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

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

// 内積 
double dot(Point a, Point b){
  return a.x*b.x+a.y*b.y;
}

// 外積
double cross(Point a, Point b){
  return a.x*b.y-a.y*b.x; 
}

//ベクトルp0p1に対する点p2の位置を求める
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){
  Point a = p1-p0;
  Point 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(a.own_dot() < b.own_dot()) return ONLINE_FRONT;
  return ON_SEGMENT;
}


vector<Point> P;
Point in[4];

bool isconvex() {
  for (int i = 0; i < P.size(); i++)
    if (ccw(prev(P, i), curr(P, i), next(P, i)) < 0) return false;
  return true;
}

int main(){
  while(1){
    char c;

    for(int i = 0; i < 4; i++)
      if(i == 3) cin >> in[i].x >> c >> in[i].y;
      else if(!(cin >> in[i].x >> c >> in[i].y >> c)) return 0;

    P.clear();

    for(int i = 0; i < 4; i++)
      P.push_back(in[i]);

    if(isconvex()) cout << "YES" << endl;
    else cout << "NO" << endl;

  }
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>

const double EPS = 1e-10;

double add( double x, double y )
{
	if( abs( x + y ) < EPS * ( abs( x ) + abs( y ) ) )
		return 0;

	return x + y;
}

struct P
{
	double x, y;

	P()
	:	x( 0 ), y( 0 )
	{}

	P( double x, double y )
	:	x( x ), y( y )
	{}

	P operator+ ( const P& p ) const
	{
		return P( add( x, p.x ), add( y, p.y ) );
	}

	P operator- ( const P& p ) const
	{
		return P( add( x, -p.x ), add( y, -p.y ) );
	}

	P operator* ( double d ) const
	{
		return P( x * d, y * d );
	}

	double dot( const P& p ) const
	{
		return x * p.x + y * p.y;
	}

	double cross( const P& p ) const
	{
		return x * p.y - y * p.x;
	}

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

int ccw( P& a, P& b, P& c )
{
	b = b - a; c = c - a;

	if( b.cross( c ) > 0 )
		return 1;	// counter clockwise
	else if( b.cross( c ) < 0 )
		return -1;	// clockwise
	else if( b.dot( c ) < 0 )
		return 2;	// c-a-b
	else if( b.norm() < c.norm() )
		return -2;	// a-b-c
}

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 )
	{
		int cw;
		bool f = true;

		for( int i = 0; i != 4; ++i )
		{
			P p( x[i], y[i] ), q( x[( i + 1 ) % 4], y[( i + 1 ) % 4] ), r( x[( i + 2 ) % 4], y[( i + 2 ) % 4] );
			
			int t = ccw( p, q, r );

			if( !i )
				cw = t;

			if( t != cw )
			{
				f = false;
				break;
			}
		}

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

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.ic", "r", stdin);
	string str = "";

	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if
		vector <double> x (4, 0. );
		vector <double> y (4, 0. );
		vector <double> vx (4, 0. );
		vector <double> vy (4, 0. );

		while (str.find(',') != string::npos ){
			str = str.replace(str.find(','), 1, " ");
		} // end while
		stringstream ss(str);
		int i;

		for (i = 0; i < 4; ++i){
			ss >> x[i] >> y[i];
		} // end for
		
		for (i = 0; i < 4; ++i){
			vx[i] = x[(i+1) % 4] - x[i];
			vy[i] = y[(i+1) % 4] - y[i];
//			cout << "v[" << i << "]: " << '(' << vx[i] << ',';
//			cout << vy[i] << ')' << endl;
		} // end for
		vector <double> inp (4, 0.);
		for (i = 0; i < 4; ++i){
//			double v2x = x[(i+2) % 4] - x[i];
//			double v2y = y[(i+2) % 4] - y[i];
			double v2x = vx[(i+1) % 4] + vx[i];
			double v2y = vy[(i+1) % 4] + vy[i];
			double v1x = vx[i];
			double v1y = vy[i];
//			cout << "v2" << '(' << v2x << ',' << v2y << ')' << endl;
//			cout << "v1" << '(' << v1x << ',' << v1y << ')' << endl;
			inp[i] = v1x*v2x + v1y*v2y;
//			cout << "inp[" << i << "]: " << inp[i] << endl;
			
			inp[i] /= sqrt (v1x*v1x + v1y*v1y)*sqrt (v2x*v2x + v2y*v2y);
//			cout << "inp[" << i << "]: " << inp[i] << endl;
		} // end for

		for (i = 0; i < 4; ++i){
			if (inp[i] <= 0.){
				break;
			} // end if
		} // end for

		if (i == 4){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if

	} // end while
		
	return 0;
}

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

struct tPoint{
	double x, y;
};

double f( double x, tPoint &a, tPoint &b ){
	return (b.y-a.y)*(x-a.x)/(b.x-a.x) + a.y;
}

int main(){
	tPoint a, b, c, d;
	string in;
	while( getline( cin, in ), in.length() ){
		sscanf( in.c_str(), "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y, &d.x, &d.y );
		bool isCrossAC, isCrossBD;
		if( b.x == d.x ){
			isCrossBD = ((a.x>b.x&&c.x<b.x)||(a.x<b.x&&c.x>b.x));
		}else{
			double fa = f( a.x, b, d );
			double fc = f( c.x, b, d );
			isCrossBD = ((a.y>fa&&c.y<fc)||(a.y<fa&&c.y>fc));
		}
		if( a.x == c.x ){
			isCrossAC = ((b.x>a.x&&d.x<a.x)||(b.x<a.x&&d.x>a.x));
		}else{
			double fb = f( b.x, a, c );
			double fd = f( d.x, a, c );
			isCrossAC = ( ((b.y>fb&&d.y<fd)||(b.y<fb&&d.y>fd)) );
		}
		if( isCrossAC && isCrossBD )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <stack>
#include <stdio.h>
using namespace std;
double a,b,c;//ax+by+c=0
double x[4],y[4];//p,1,2,3
void make_line(double x1,double y1,double x2,double y2){
    if(x1!=x2&&y1!=y2){
        a=(y1-y2)/(x1-x2);
        b=-1;
        c=-a*x1+y1;
    }else if(x1==x2){
        a=1;
        b=0;
        c=-x1;
    }else if(y1==y2){
        a=0;
        b=1;
        c=-y1;
    }
    return;
}
bool check(int p,int q,int r){//whether the point is r side or not
    make_line(x[p],y[p],x[q],y[q]);//line pq
    if((a*x[r]+b*y[r]+c)*(a*x[0]+b*y[0]+c)<=0)return false;
    return true;
}
 
int main()
{
	char c;
    while(cin>>x[1]>>c>>y[1]>>c>>x[2]>>c>>y[2]>>c>>x[3]>>c>>y[3]>>c>>x[0]>>c>>y[0]){
        bool ans=true;
        ans&=check(1,2,3);
        ans&=check(2,3,1);
        ans&=!check(3,1,2);
        printf(ans?"YES\n":"NO\n");
    }
    return 0;
}