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 <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <stack>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}

typedef pair<double, double> xy;

const double ERR = 1e-8;
double rnddouble(double d) {
    long l = 1 / ERR;
    return (double)round(d * l) / l;
}

double area(xy A, xy B, xy C) {
    double ab = sqrt((A.first-B.first)*(A.first-B.first) + (A.second-B.second)*(A.second-B.second));
    double ac = sqrt((A.first-C.first)*(A.first-C.first) + (A.second-C.second)*(A.second-C.second));
    double bc = sqrt((B.first-C.first)*(B.first-C.first) + (B.second-C.second)*(B.second-C.second));
    double b = rnddouble(ab*ab+ac*ac-bc*bc)/2/ab/ac;
    double theta = acos(b);
    double a = 0.5 * ab * ac * sin(theta);
    return a;
}

bool insideTriangle(xy A, xy B, xy C, xy P) {
    if (abs(area(A,B,P) + area(B,C,P) + area(C,A,P) - area(A,B,C)) < ERR) return true;
    return false;
}

xy middle(xy A, xy B) {
    return make_pair((A.first+B.first)/2, (A.second+B.second)/2);
}

int main() {
    float x1,y1,x2,y2,x3,y3,x4,y4;
    while(scanf("%f,%f,%f,%f,%f,%f,%f,%f", &x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) {
        xy A, B, C, D;
        A = make_pair(x1, y1);
        B = make_pair(x2, y2);
        C = make_pair(x3, y3);
        D = make_pair(x4, y4);
        if ((insideTriangle(A, B, D, middle(A,C)) || insideTriangle(C, B, D, middle(A,C)))
            && (insideTriangle(A, B, D, middle(B,D)) || insideTriangle(C, B, D, middle(B,D)))) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#define EPS 1e-10
using namespace std;

struct P{
  double x,y;
};
double det(P&p,P&q,P&r)
{
  return (q.x-p.x)*(r.y - q.y) - (q.y - p.y)*(r.x - q.x); 
}
int main()
{

  P p[4];
  char c;
  while(cin >> p[0].x >>c>> p[0].y){ 
  for(int i = 1 ; i < 4 ; i++ ){
    cin >>c>> p[i].x >>c>> p[i].y;
  }
  int f = 0;
  for(int i = 0 ; i < 4 ; i++ ){
    if(det(p[i%4],p[(i+1)%4],p[(i+2)%4]) <= 0.0){
      cout << "NO" << endl;
      f = 1;
      break;
    }
  }
  if(f == 0)cout << "YES" << endl;
  }
  return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define EPS (1e-8)

typedef complex<double> p;
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

double cross(p a, p b) {
	return ( a.real() * b.imag() - a.imag() * b.real() );
}


int main() {
	while (true) {
		double x[4], y[4];
		if (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) break;
		p point[4];
		REP(i, 4) point[i] = p(x[i], y[i]);
		
		int cnt[2] = {};
		REP(i, 4) {
			p v[2];
			v[0] = point[(i + 1) % 4] - point[i];
			v[1] = point[(i + 2) % 4] - point[i];
			
			if (cross(v[0], v[1]) < -EPS) cnt[0]++;
			else cnt[1]++;
		}
		
		if (cnt[0] == 4 || cnt[1] == 4) puts("YES");
		else puts("NO");
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	double xa, ya, xb, yb, xc, yc, xd, yd,s1,s2,s3,s4;
	while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF) {
		s1=abs((xc - xa)*(yb - ya) - (xb - xa)*(yc - ya));
		s2 = abs((xc - xa)*(yd - ya) - (xd - xa)*(yc - ya));
		s3 = abs((xb - xa)*(yd - ya) - (xd - xa)*(yb - ya));
		s4 = abs((xb - xc)*(yd - yc) - (xd - xc)*(yb - yc));
		if (s1 + s2 == s3 + s4) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <complex>
#include <iostream>
using namespace std;
typedef complex<double> P;
double cr(P a, P b) {
  return (conj(a) * b).imag();
}
int main() {
  P a, b, c, d;
  double x1, y1, x2, y2, x3, y3, x4, y4;
  char cm;
  while (cin >> x1 >> cm >> y1 >> cm >> x2 >> cm >> y2 >> cm >> x3 >> cm >> y3
    >> cm >> x4 >> cm >> y4) {
    a = P(x1, y1), b = P(x2, y2), c = P(x3, y3), d = P(x4, y4);
    P e = a - b, f = b - c, g = c - d, h = d - a;
    double i = cr(e, f), j = cr(f, g), k = cr(g, h), l = cr(h, e);
    cout
      << ((i > 0 && j > 0 && k > 0 && l > 0)
        || (i < 0 && j < 0 && k < 0 && l < 0) ? "YES" : "NO") << endl;
  }
}

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

typedef complex<double> P;

#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()) )


double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}

bool inTriangle(P v1,P v2,P v3,P v){
	if(cross(v2-v1,v-v1)<-EPS&&cross(v3-v2,v-v2)<-EPS&&cross(v1-v3,v-v3)<-EPS)return true;
	else if(cross(v2-v1,v-v1)>EPS&&cross(v3-v2,v-v2)>EPS&&cross(v1-v3,v-v3)>EPS)return true;
	return false;
}

P data[4];
bool input(){
	char c;
	
	for(int i=0;i<4;i++){
		if(!(cin>>data[i].real()))return false;
		cin>>c;
		cin>>data[i].imag();
		if(i<3)cin>>c;
	}
	return true;
}
int main(){
	while(input()){
		
		for(int i=0;i<4;i++){
			vector<P>v;
			for(int j=0;j<4;j++){
				if(j!=i)v.push_back(data[j]);
			}
			if(inTriangle(v[0],v[1],v[2],data[i])){
				cout<<"NO"<<endl;
				goto fail;
			}
		}
		cout<<"YES"<<endl;
		fail:;
	}
	
}