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

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

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

	return 0;
}

istream& operator >> ( istream& s , point& p )
{
	return s >> p.x >> 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;
}

C++: #include<cstdio>

#define	EPS		1e-9
#define	pb(a)	push_back(a);

#define	ID_CCW	0
#define	ID_CW	1
#define	ID_GO	2
#define	ID_BACK	3

using namespace std;

class Point{
public:
	double x,y;
	Point(){}
	Point(double xx,double yy) : x(xx),y(yy){}
};

Point &operator -=(Point &a,const Point &b)
{
	a.x-=b.x;
	a.y-=b.y;
	return a;
}

double dot(const Point &a,const Point &b)
{
	return a.x*b.x+a.y*b.y;
}

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

int ccw(const Point &a,Point b,Point c)
{
	b-=a;
	c-=a;
	double rotdir=cross(b,c);
	if(rotdir>EPS)		return ID_CCW;
	if(rotdir<-EPS)		return ID_CW;
	if(dot(b,c)>EPS)	return ID_GO;
	return ID_BACK;
}

int main()
{
	Point p[4];
	while(1){
		if(scanf("%lf,%lf",&p[0].x,&p[0].y)==EOF)	break;
		for(int i=1;i<4;i++)	scanf(",%lf,%lf",&p[i].x,&p[i].y);
		bool b1=true;
		for(int i=0;i<4;i++)	if(ccw(p[i],p[(i+1)%4],p[(i+2)%4])!=ID_CCW)	b1=false;
		bool b2=true;
		for(int i=0;i<4;i++)	if(ccw(p[i],p[(i+1)%4],p[(i+2)%4])!=ID_CW)	b2=false;
		puts(b1||b2?"YES":"NO");
	}
	return 0;
}

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

double spase(double a,double b,double c){
	return sqrt((a+b+c)*(b-a+c)*(a-b+c)*(a+b-c));
}

int main(){
	double a,b,c,d,e,f,g,h,AB,BC,CD,DA,AC,BD,abc,bcd,cda,dab;
	while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h) != EOF ){
		AB=sqrt((a-c)*(a-c)+(b-d)*(b-d));
		BC=sqrt((c-e)*(c-e)+(d-f)*(d-f));
		CD=sqrt((e-g)*(e-g)+(f-h)*(f-h));
		DA=sqrt((g-a)*(g-a)+(h-b)*(h-b));
		AC=sqrt((a-e)*(a-e)+(b-f)*(b-f));
		BD=sqrt((c-g)*(c-g)+(d-h)*(d-h));
		abc=((a-c)*(c-e)+(b-d)*(d-f))/AB/BC;
		bcd=((c-e)*(e-g)+(d-f)*(f-h))/BC/CD;
		cda=((e-g)*(g-a)+(f-h)*(h-b))/CD/DA;
		dab=((g-a)*(a-c)+(h-b)*(b-b))/DA/AB;
		abc=acos(abc)+acos(bcd)+acos(cda)+acos(dab);
		//printf("%lf %lf %lf %lf\n",abc,2*M_PI,spase(AB,BC,AC)+spase(CD,DA,AC),spase(DA,AB,BD)+spase(CD,BC,BD));
		if(((float)(abc-2*M_PI)==0)&&((float)(spase(AB,BC,AC)+spase(CD,DA,AC)-spase(DA,AB,BD)-spase(CD,BC,BD))==0)){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}