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>
using namespace std;

class Vector2{
public:
	Vector2() : x( 0 ), y( 0 ){}
	Vector2( Vector2& a ){
		x = a.x;
		y = a.y;
	}
	Vector2( Vector2& a, Vector2& b ){
		x = b.x - a.x;
		y = b.y - a.y;
	}

	double cross( Vector2& a ){
		return ( x * a.y ) - ( y * a.x );
	}

	double x, y;
};

int main(){
	Vector2 a, b, c, d;
	char s;

	while ( cin >> a.x >> s >> a.y >> s >> b.x >> s >> b.y >> s
				>> c.x >> s >> c.y >> s >> d.x >> s >> d.y ){

		Vector2 ab( a, b ), bc( b, c ), cd( c, d ), da( d, a );
		double ap, bp, cp, dp;

		ap = da.cross( ab );
		bp = ab.cross( bc );
		cp = bc.cross( cd );
		dp = cd.cross( da );

		if ( ( ap > 0 && bp > 0 && cp > 0 && dp > 0 ) || ( ap < 0 && bp < 0 && cp < 0 && dp < 0 ) ){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
		
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    while(true){
        double xa, ya, xb, yb, xc, yc, xd, yd;
        if(!(cin>>xa)) break;
        cin.ignore();
        cin>>ya;
        cin.ignore();
        cin>>xb;
        cin.ignore();
        cin>>yb;
        cin.ignore();
        cin>>xc;
        cin.ignore();
        cin>>yc;
        cin.ignore();
        cin>>xd;
        cin.ignore();
        cin>>yd;
    
        double pc = (xb-xd)*(yc-yd)-(yb-yd)*(xc-xd);
        double qc = (xa-xd)*(yc-yd)-(ya-yd)*(xc-xd);
        double  m = (xa-xc)*(yb-yd)-(ya-yc)*(xb-xd);
        
        double p=pc/m, q=qc/m;
        if(0<=p&&p<=1 && 0<=q&&q<=1) cout<<"YES\n";
        else cout<<"NO\n";
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <complex>
#include <cstdio>
#define EPS 1e-10
#define EQ(a,b) (abs(a - b) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))
using namespace std;

typedef complex<double> P;

double angle (double c, double b, double a) {
    return (acos((b*b + c*c - a*a) / (2*b*c)) * 180.0 / M_PI);
}

int main ()
{
    double ax, ay, bx, by, cx, cy, dx, dy;
    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &ax, &ay, &bx, &by, &cx, &cy, &dx, &dy) != EOF) {
        P a = P(ax, by);
        P b = P(bx, by);
        P c = P(cx, cy);
        P d = P(dx, dy);

        double angles = 0.0;
        angles += angle(abs(a - d), abs(a - b), abs(d - b));
        angles += angle(abs(b - a), abs(b - c), abs(a - c));
        angles += angle(abs(c - b), abs(c - d), abs(d - b));
        angles += angle(abs(d - a), abs(d - c), abs(a - c));

        if (EQ(angles, 360.0)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}

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

int main(){
	char trash;
	double x[4], y[4];
	while(cin >> x[0] >> trash >> y[0]){
		double a,b,c,d,e,f,t,r;
		for(int i = 1; i < 4; i++){
			cin >> trash >> x[i] >> trash >> y[i];
		}
		a = y[2]-y[0];
		b = -x[2]+x[0];
		e = -1*(y[0]*(x[2]-x[0])-x[0]*(y[2]-y[0]));
		c = y[3]-y[1];
		d = -x[3]+x[1];
		f = -1*(y[1]*(x[3]-x[1])-x[1]*(y[3]-y[1]));
		t = (e*d-b*f)/(a*d-b*c);
		r = (a*f-c*e)/(a*d-b*c);
		if(x[2] < x[0]){
			swap(x[0],x[2]);
		}
		if(x[3] < x[1]){
			swap(x[1],x[3]);
		}
		if(y[2] < y[0]){
			swap(y[0],y[2]);
		}
		if(y[3] < y[1]){
			swap(y[1],y[3]);
		}
		if((t >= x[0] && t <= x[2]) && (t >= x[1] && t <= x[3]) && (r >= y[0] && r < y[2]) && (r >= y[1] && r < y[3])){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}

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_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_convex( 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 <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};

 


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){
    double td =(xa-xc)*(yd-ya)+(ya-yc)*(xa-xd);
    double tb =(xa-xc)*(yb-ya)+(ya-yc)*(xa-xb);
    double ta =(xb-xd)*(ya-yb)+(yb-yd)*(xb-xa);
    double tc =(xb-xd)*(yc-yb)+(yb-yd)*(xb-xc);

    if(td*tb >0.0||ta*tc>0.0)
      cout <<"NO"<<endl;
    else
      cout <<"YES"<<endl;
  }
  return 0;
}