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 PI 3.14159265358979

using namespace std;

double f(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4)
{
	return ((x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

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)
	{
		if(f(x[0],y[0],x[2],y[2],x[1],y[1],x[3],y[3])>0 || f(x[1],y[1],x[3],y[3],x[0],y[0],x[2],y[2])>0)cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0;
}

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

int main()
{
	const double PI = 3.14159265358979;
	double x[4], y[4];
	complex<double> z[4];
	char c;

	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]) {

		for (int i = 0; i < 4; i++) {
			z[i].real(x[i]);
			z[i].imag(y[i]);
		}

		bool f = 1;

		for (int i = 0; i < 4; i++) {
			int j = (i + 1) % 4, k = (i + 2) % 4;
			double t = arg((z[k] - z[j]) / (z[j] - z[i]));
			if (!(t > 0 && t < PI)) {
				f = 0;
				break;
			}
		}

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

	return 0;
}

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

struct Vec2d{
  double x,y;
};

double cross(Vec2d &A, Vec2d &B){
  return A.x*B.y - A.y*B.x;
}

int main(void){
  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){
    bool f=true;
    for(int i=0;i<4;++i){
      double xx[3],yy[3];
      double xp = x[i], yp = y[i];
      int cnt=0;
      for(int j=0;j<4;++j){
        if(i==j) continue;
        xx[cnt] = x[j];
        yy[cnt] = y[j];
        ++cnt;
      }
      Vec2d AB,AP,BC,BP,CA,CP;
      AB.x = xx[1]-xx[0]; AB.y = yy[1]-yy[0];
      BC.x = xx[2]-xx[1]; BC.y = yy[2]-yy[1];
      CA.x = xx[0]-xx[2]; CA.y = yy[0]-yy[2];
      AP.x = xp-xx[0]; AP.y = yp-yy[0];
      BP.x = xp-xx[1]; BP.y = yp-yy[1];
      CP.x = xp-xx[2]; CP.y = yp-yy[2];
      if(cross(AB,AP)>0.0 && cross(BC,BP)>0.0 && cross(CA,CP)>0.0)
        f=false;
      else if(cross(AB,AP)<0.0 && cross(BC,BP)<0.0 && cross(CA,CP)<0.0)
        f=false;
      else ;
    }
    cout<<((f)?"YES":"NO")<<endl;
  }
  return 0;
}

C++: #include <stdio.h>
#define S(x,y,a,b,l,r) ((x*b+a*r+l*y-y*a-l*b-r*x)>0?0:((x*b+a*r+l*y-y*a-l*b-r*x)<0?1:2))
int main() {double a,b,c,d,o,p,q,r;while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&o,&p,&q,&r)!=EOF) {int T[4]={0,0,0,0};T[S(a,b,c,d,o,p)]++,T[S(c,d,o,p,q,r)]++,T[S(o,p,q,r,a,b)]++,T[S(q,r,a,b,c,d)]++;if (T[0]&&T[1]) puts("NO"); else puts("YES");} return 0;}

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

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

#define X real()
#define Y imag()
typedef complex<double> P;

double cross(P a,P b){return a.X*b.Y-a.Y*b.X;}
bool ccw(P a,P b,P c){return cross(b-a,c-a)>=0;}

int main(){
	
	double a[8];
	
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7])!=EOF){
		
		P b[4];
		rep(i,4)b[i]=P((double)a[i*2],(double)a[i*2+1]);
		
		bool ok = true;
		rep(i,4){
			if(!ccw(b[i],b[(i+1)%4],b[(i+2)%4]))ok=false;
		}
		if(ok)puts("YES");
		else puts("NO");
	}
	
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

struct vector2D{
  double x;
  double y;
};

vector2D subVector(const vector2D& t1, const vector2D& t2) {
  vector2D ret;
  ret.x = t1.x - t2.x;
  ret.y = t1.y - t2.y;
  return ret;
}

bool hittest(vector2D a, vector2D b, vector2D c, vector2D p) {
  vector2D AB = subVector(b, a);
  vector2D BP = subVector(p, b);

  vector2D BC = subVector(c, b);
  vector2D CP = subVector(p, c);

  vector2D CA = subVector(a, c);
  vector2D AP = subVector(p, a);

  double c1 = AB.x * BP.y - AB.y * BP.x;
  double c2 = BC.x * CP.y - BC.y * CP.x;
  double c3 = CA.x * AP.y - CA.y * AP.x;

  if( ( c1 > 0 && c2 > 0 && c3 > 0 ) || ( c1 < 0 && c2 < 0 && c3 < 0 ) ) {
    return true;
  }

  return false;
}

signed main(void)
{
  vector2D p1, p2, p3, p4;
  while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&p1.x,&p1.y,&p2.x,&p2.y,&p3.x,&p3.y,&p4.x,&p4.y)) {
    if(hittest(p1, p2, p3, p4) || hittest(p1, p2, p4, p3) || hittest(p1, p3, p4, p2) || hittest(p2, p3, p4, p1)) cout << "NO" << endl;
    else cout << "YES" << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

struct Point{
	double x,y;
	Point operator - (const Point a){
		Point res;
		res.x=x-a.x;
		res.y=y-a.y;
		return res;
	}
};

typedef Point Vector;

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

Vector v[4];

double c[4];

int main(){
	while (1){
		if (scanf("%lf,%lf,",&v[0].x,&v[0].y)==EOF) break;
		FOR(i,1,4){
			scanf("%lf,%lf,",&v[i].x,&v[i].y);
		}
		bool flg=true;
		REP(i,4){
			c[i]=cross(v[(i+1)%4]-v[i],v[(i+2)%4]-v[(i+1)%4]);
		}
		REP(i,4){
			if (c[i]*c[(i+1)%4]<0) flg=false;
		}
		if (flg){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

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

typedef complex<double> Point;

#define X real()
#define Y imag()

Point ps[4];

double dot(Point a, Point b) {
  return (conj(a)*b).X;
}

double cross(Point a, Point b) {
  return (conj(a)*b).Y;
}

bool ccw(Point a, Point b, Point c) {
  return cross(c-b, a-b) > 0.0;
}

int main() {
  while (1) {
    for (int i=0; i<4; i++) {
      double x, y;
      if (scanf("%lf,%lf", &x, &y) != 2) return 0;
      getchar();
      ps[i] = Point(x, y);
    }
  
    bool base = ccw(ps[0], ps[1], ps[2]);
    bool is_convex = true;
    for (int i=1; i<4; i++) {
      is_convex &= (base == ccw(ps[i], ps[(i+1)%4], ps[(i+2)%4]));
    }

    if (is_convex) puts("YES");
    else puts("NO");
  }
}