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 <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <complex>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)

typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = (1e-10);    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) {
  return (conj(a)*b).Y;
}

int ccw(P a, P b, P c) {
  b -= a;  c -= a;
  if (cross(b,c) >  EPS) return +1;  // counter clockwise
  if (cross(b,c) < -EPS) return -1;  // clockwise
  if (dot(b,c)   < -EPS) return +2;  // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line or a==b
  return 0;                          // a--c--b on line or a==c or b==c
}

int main() {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF) {
    P p[4] = {P(xa, ya), P(xb, yb), P(xc, yc), P(xd, yd)};

    bool ok = true;
    for (int i = 0; i < 4; i++) {
      if (ccw(p[i], p[(i+1)%4], p[(i+2)%4]) != ccw(p[(i+1)%4], p[(i+2)%4], p[(i+3)%4])) {
        ok = false;
        break;
      }
    }

    if (ok) {
      std::cout << "YES" << std::endl;
    }else {
      std::cout << "NO" << std::endl;
    }
  }
  
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <complex>
#define EPS 1e-10
#define EQ(a, b) abs((a) - (b)) < EPS
using namespace std;
typedef complex<double> P;

double cross(P a, P b) {
    return(a.real() * b.imag() - a.imag() * b.real());
}
bool isPalallel(P a1, P a2, P b1, P b2) {
    return(EQ(cross(a1-a2, b1-b2), 0.0));
}

int main(void) {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF) {
        P a(xa, ya), b(xb, yb), c(xc, yc), d(xd, yd);
        if(isPalallel(a, b, d, c) && isPalallel(d, a, c, b)) 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;
		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);
		if(x[2] < x[0]){
			swap(x[0],x[2]);
		}
		if(x[3] < x[1]){
			swap(x[1],x[3]);
		}
		if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}

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

double cross(complex<double> z1, complex<double> z2) {
	return z1.real() * z2.imag() - z1.imag() * z2.real();
}

int main() {
	double x1, y1, x2, y2, x3, y3, x4, y4;
	while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) != EOF) {
		complex<double> a(x1, y1), b(x2, y2), c(x3, y3), d(x4, y4);

		double ab, bc, cd, da;
		ab = cross(b - a, c - b);
		bc = cross(c - b, d - c);
		cd = cross(d - c, a - d);
		da = cross(a - d, b - a);

		if ((ab > 0 && bc > 0 && cd > 0 && da > 0) || (ab < 0 && bc < 0 && cd < 0 && da < 0)) {
			cout << "YES";
		}else {
			cout << "NO";
		}
		cout << endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }
const double EPS=1e-10;
int sig(double r){return (r<-EPS)?-1:(r>EPS)?:0;}
struct Pt{
	double x,y;
	Pt(){}
	Pt(double x,double y) : x(x),y(y){}
	Pt operator+(const Pt &a)const{return Pt(x+a.x,y+a.y);}
	Pt operator-(const Pt &a)const{return Pt(x-a.x,y-a.y);}
	Pt operator*(const Pt &a)const{return Pt(x*a.x-y*a.y,x*a.y+y*a.x);}
	double det(const Pt &a)const{return x*a.y-y*a.x;}
};
double tri(Pt a,Pt b,Pt c){return (b-a).det(c-a);}
bool iSSstrict(Pt a,Pt b,Pt c,Pt d){
	return ((sig(tri(a,b,c)))*sig(tri(a,b,d))<0&&(sig(tri(c,d,a)))*sig(tri(c,d,b))<0);
}
int main() {
	Pt a,b,c,d;
	for(;~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf\n",&(a.x),&(a.y),&(b.x),&(b.y),&(c.x),&(c.y),&(d.x),&(d.y));){
		cout<<(iSSstrict(a,b,c,d)||iSSstrict(a,c,b,d)||iSSstrict(a,d,c,b)?"YES":"NO")<<endl;
	}
	return 0;
}