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<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
const double EPS = 1e-8;
const double INF = 1e12;
#define PI 2*acos(0.0)
typedef complex<double> P;
namespace std { bool operator < (const P& a, const P& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } }
namespace std { bool operator == (const P& a, const P& b) { return abs(real(a) - real(b)) < EPS && abs(imag(a) - imag(b)) < EPS; } }
double cross(const P& a, const P& b) { return imag(conj(a)*b); }
double dot(const P& a, const P& b) { return real(conj(a)*b); }
struct L : public vector<P> { L() {} L(const P &a, const P &b) { push_back(a); push_back(b); } };
typedef vector<P> G;
struct C { P p; double r; C() {} C(const P &p, double r) : p(p), r(r) {} };
int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if (cross(b, c) > 0)   return +1;       // counter clockwise
	if (cross(b, c) < 0)   return -1;       // clockwise
	if (dot(b, c) < 0)     return +2;       // c--a--b on line
	if (norm(b) < norm(c)) return -2;       // a--b--c on line
	return 0;
}
/*---------------------------------------------------------------------------------------------------
????????????????????????????????? ??§?????§  
??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!
???????????? ??? ?´_???`??????/??? ???i     
?????????????????????????????? ???  |???|     
????????? /?????? /??£??£??£??£/??????|  
??? ???_(__??????/???    ???/ .| .|????????????  
??? ????????????/????????????/??????u??????  
---------------------------------------------------------------------------------------------------*/






//---------------------------------------------------------------------------------------------------
void _main() {
    double a, b, c, d, e, f, g, h;
    while (~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a, &b, &c, &d, &e, &f, &g, &h)) {
        vector<P> v;
        v.push_back(P(a, b));
        v.push_back(P(c, d));
        v.push_back(P(e, f));
        v.push_back(P(g, h));

        set<int> s;
        rep(i, 0, 4) {
            int j = (i + 1) % 4;
            int k = (i + 2) % 4;

            s.insert(ccw(v[i], v[j], v[k]));
        }

        if (s.size() == 1) printf("YES\n");
        else printf("NO\n");
    }
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<map>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  double x[6];
  double y[6];
  while(2==scanf("%lf,%lf,",&x[1],&y[1])){
    REP(i,3) scanf("%lf,%lf,",&x[i+2],&y[i+2]);
    x[5] = x[1];
    x[0] = x[4];
    y[5] = y[1];
    y[0] = y[4];
    int ans = 0;
    REP(i,4){
      double dx1 = x[i+1] - x[i];
      double dx2 = x[i+2] - x[i+1];
      double dy1 = y[i+1] - y[i];
      double dy2 = y[i+2] - y[i+1];
      if(dx1 * dy2 < dx2 * dy1) ans++;
      else ans--;
    }
    if(ans == 4 || ans == -4) ans = 1;
    else ans = 0;
    puts(ans?"YES":"NO");
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
#define EPS 1e-12
using namespace std;
struct P{
  double x,y;
  P(){}
  P(double x,double y):x(x),y(y){}
  P operator - (P p){
    return P(x - p.x,y - p.y);
  }
  double det(P p){
    return x*p.y - y*p.x;
  }
};
int main(){
  P a[4];
  char e;
  while( cin >> a[0].x >> e >> a[0].y){
    int flag = 1;
    for(int i = 1 ; i < 4 ; i++ ){
      cin >> e >> a[i].x >> e >>  a[i].y;
    }
    for(int i = 0 ; i < 4 ; i++ ){
      if((a[(i + 1)%4] - a[i]).det( a[(i + 2)%4] - a[(i + 1)%4] ) < -EPS){
	cout << "NO" << endl;
	flag = 0;
	break;
      }
    }
    if(flag)cout << "YES" << endl;
  }
}

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

//??´???AB????§?????????´???BC????§??????????RotType????¨????(A???B???C????????§??????)
//RotType = ????????¢1, ????????¢-1, ??´???0
int getRotType( double angle_a, double angle_b ){
	const int eps = 1e-8;
	const double PAI = 3.14159265358979;
	
	if( fabs(angle_a - angle_b) <= eps )
		return 0;
	if( angle_a > angle_b + PAI )
		angle_b += 2 * PAI;
	else if( angle_b > angle_a + PAI )
		angle_a += 2 * PAI;
	
	if( angle_b > angle_a )	//?§????????¢????????????????
		return 1;
	return -1;	//?§???????????°?????????????
}

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]))
	{
		//A???B???C, B???C???D, C???D???A?????????????????¨???????????????????????????
		double ang[4];
		
		for( int i = 0; i < 4; i++ )
			ang[i] = atan2(y[(i+1)%4] - y[i%4], x[(i+1)%4] - x[i%4]);
		
		double angType[4];
		for( int i = 0; i < 4; i++ )
			angType[i] = getRotType( ang[i], ang[(i+1)%4] );
		
		int i;
		for( i = 0; i < 3; i++ ){
			if( angType[i] != angType[i+1] )
				break;
		}
		if( i == 3 )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}