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 <string>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <ctime>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int const MOD = 1000000007;

// 2???????????????????????????????±???????
double dot(P a, P b) {
    return (a.X * b.X + a.Y * b.Y);
}

// 2???????????????????????????????±???????
double cross(P a, P b) {
    return (a.X * b.Y - a.Y * b.X);
}

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

int main() {
    P a, b, c, d;
    while(~scanf("%f,%f,%f,%f,%f,%f,%f,%f", &a.X, &a.Y, &b.X, &b.Y, &c.X, &c.Y, &d.X, &d.Y)) {
        int p,q,r,s;
        p = ccw(a,c,b);
        q = ccw(b,d,c);
        r = ccw(c,a,d);
        s = ccw(d,b,a);
        if(p == q && q == r && r == s) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
double xa,ya,xb,yb,xc,yc,xd,yd;
int a,cnt,cnt2;
char ch;
int f(double x1,double y1,double x2,double y2){
  double a =x1*x2+y2*y1;//= x1*y2 - x2*y1;
  //cout<<a<<endl;
  if(a>0.0)return 1;
  if(a<0.0)return -1;
  return 0;
}
int main(){
  while(cin>>xa>>ch>>ya>>ch>>xb>>ch>>yb>>ch>>xc>>ch>>yc>>ch>>xd>>ch>>yd){
    a=f(xa-xb,ya-yb,xb-xc,yb-yc);
    if(a>0)cnt++;
    else if(a==0)cnt++,cnt2++;
    else cnt2++;

    a=f(xb-xc,yb-yc,xc-xd,yc-yd);
    if(a>0)cnt++;
    else if(a==0)cnt++,cnt2++;
    else cnt2++;

    a=f(xc-xd,yc-yd,xd-xa,yd-ya);
    if(a>0)cnt++;
    else if(a==0)cnt++,cnt2++;
    else cnt2++;

    a=f(xd-xa,yd-ya,xa-xb,ya-yb);
    if(a>0)cnt++;
    else if(a==0)cnt++,cnt2++;
    else cnt2++;

    if(cnt==4||cnt2==4)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}

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

float spase(float a,float b,float c){
	return sqrt((a+b+c)*(b-a+c)*(a-b+c)*(a+b-c));
}

int main(){
	float a,b,c,d,e,f,g,h,AB,BC,CD,DA,AC,BD,abc,bcd,cda,dab;
	while( scanf("%f,%f,%f,%f,%f,%f,%f,%f",&a,&b,&c,&d,&e,&f,&g,&h) != EOF ){
		AB=sqrt((a-c)*(a-c)+(b-d)*(b-d));
		BC=sqrt((c-e)*(c-e)+(d-f)*(d-f));
		CD=sqrt((e-g)*(e-g)+(f-h)*(f-h));
		DA=sqrt((g-a)*(g-a)+(h-b)*(h-b));
		AC=sqrt((a-e)*(a-e)+(b-f)*(b-f));
		BD=sqrt((c-g)*(c-g)+(d-h)*(d-h));
		abc=((a-c)*(c-e)+(b-d)*(d-f))/AB/BC;
		bcd=((c-e)*(e-g)+(d-f)*(f-h))/BC/CD;
		cda=((e-g)*(g-a)+(f-h)*(h-b))/CD/DA;
		dab=((g-a)*(a-c)+(h-b)*(b-d))/DA/AB;
		//printf("%f %f %f %f\n",abc,bcd,cda,dab);
		//printf("%f %f %f %f\n",acos(abc),acos(bcd),acos(cda),acos(dab));
		abc=acos(abc)+acos(bcd)+acos(cda)+acos(dab);
		//printf("%f %f %f %f\n",abc,2*M_PI,spase(AB,BC,AC)+spase(CD,DA,AC),spase(DA,AB,BD)+spase(CD,BC,BD));
		//printf("%d %d\n",(abc-(float)(2*M_PI))==0,(spase(AB,BC,AC)+spase(CD,DA,AC))==(spase(DA,AB,BD)+spase(CD,BC,BD)));
		if(((abc-(float)(2*M_PI))==0)&&((spase(AB,BC,AC)+spase(CD,DA,AC))==(spase(DA,AB,BD)+spase(CD,BC,BD)))){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>
#include <sstream>

using namespace std;

double EPS = 1e-12;

//誤差を考慮して足し算を行う
double add(double a, double b) {
	if( abs(a + b) < EPS * (abs(a) + abs(b))) {
		return 0;
	}

	return a + b;
}

//二次元ベクトル構造体
struct P {
	double x, y;

	P() {};
	P(double x, double y) : x(x), y(y) {
	}
	P operator + (P p) {
		return P(add(x, p.x), add(y, p.y));
	}
	P operator - (P p) {
		return P(add(x, -p.x), add(y, -p.y));
	}
	P operator * (double d) {
		return P(x * d, y * d);
	}
	double dot(P p) {	//　内積
		return add(x * p.x, y * p.y);
	}
	double det(P p) {	//　外積
		return add(x * p.y, -y * p.x);
	}
};

//　線分p1-p2上に点qがあるか判定
bool on_seg(P p1, P p2, P q) {
		return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0;
}

//　直線p1-p2と直線q1-q2の交点
P intersection(P p1, P p2, P q1, P q2) {
	return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}

int ccw(P a, P b, P c) {
	a = b - a;
	b = c - b;

	if(a.det(b) < 0) {
		return -1;
	} else if(a.det(b) > 0) {
		return 1;
	}

	return 0;
}


int main() {

	string str;
    while (getline(cin, str)) {
        replace(str.begin(), str.end(), ',', ' ');
        stringstream buf(str);
        P p[4];
        for (int i = 0; i < 4; i++) {
            buf >> p[i].x >> p[i].y;
        }
 
        int cnt = 0, n = 0;
        for (int i = 0; i < 4; i++) {
            int c = ccw(p[i], p[(i+1)%4], p[(i+2)%4]);
            cnt += c;
            n += abs(c);
        }
 
        cout << (abs(cnt) == n ? "YES" : "NO") << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
const int INF = 1<<28;
struct Vec{
  double x;
  double y;
};
vector<string> split(const string &str, char delim){
  vector<string> res;
  size_t current = 0, found;
  while((found = str.find_first_of(delim, current)) != string::npos){
    res.push_back(string(str, current, found - current));
    current = found + 1;
  }
  res.push_back(string(str, current, str.size() - current));
  return res;
}

double cross(Vec &a,Vec &b){
  return a.x*b.y - a.y*b.x;
}
bool cal(int p,vector<double> &val){
  int np = p;
  int cnt = 0;
  vector<double> ans(3);
  while(cnt < 3){
    np++;
    np %=4;
    int nnp = (np+1)%4;
    if(cnt==2)nnp = (nnp+1)%4;
    Vec a;
    a.x = val[nnp*2] - val[np*2];
    a.y = val[nnp*2+1] - val[np*2+1];
    Vec b;
    b.x = val[p*2] - val[np*2];
    b.y = val[p*2+1] - val[np*2+1];
    ans[cnt] = cross(a,b);
    cnt++;
  }

  if(ans[0] < 0 && ans[1] < 0 && ans[2] < 0)return true;
  else if(ans[0] > 0 && ans[1] > 0 && ans[2] > 0)return true;
  return false;
}
int main(){
  string str;
  while(cin >> str){
    vector<string> s_v = split(str,',');
    vector<double> val(8);
    for(int i = 0;i < 8;i++){
      val[i] = stod(s_v[i]);
    } 
    int flag = 0;
    for(int i = 0;i < 4;i++){
      if(cal(i,val))flag = 1;
    }
    if(flag)cout << "NO" << endl;
    else cout << "YES" << endl;
  }
  return 0;
}