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 <complex>
using namespace std;

const double EPS = 1.0e-6;

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) > 0){
		//printf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf\n",xa,ya,xb,yb,xc,yc,xd,yd);
		complex<double> v[4];
		v[0] = complex<double>(xb-xa, yb-ya);
		v[1] = complex<double>(xc-xb, yc-yb);
		v[2] = complex<double>(xd-xc, yd-yc);
		v[3] = complex<double>(xa-xd, ya-yd);
		
		int p = 0;
		int m = 0;
		for(int i=0; i<4; i++){
			if( imag(conj(v[i])*v[(i+1)%4]) < 0){
				m++;
			} else {
				p++;
			}
		}
		if(m==4||p==4) cout<<"YES";
		else           cout<<"NO";
		cout<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<numeric>
#include<complex>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define reps(i,s,n) for(int i=s;i<n;i++)
using namespace std;
typedef long long ll;
typedef long double ld;

typedef complex<double> P;
int main(){
  IOS;
  // ld a[2],b[2],c[2],d[2]

  ld x,y;
  char c;
  P p[4];
  while(1){
    int che=0;
    rep(i,4){
      // cin>>x>>c>>y;
      if(!((cin>>x).ignore()>>y).ignore()) return 0;
      p[i]=P(x,y);
    }
    bool a[2]={};
    rep(i,4){
      // cout<<i<< " "<<p[i]<<endl;
      P c=p[i]-p[(i+1)%4], d=p[(i+1)%4]-p[(i+2)%4];
      // cout<< c<<" "<<d<<endl;
      // cout<<i<<c<<d<<endl;
      if(c.real()*d.imag()-c.imag()*d.real()>0){
        che+=1;
        // cout<<i<<c<<d<<endl;
      }
      // cout<<a[0]<<" "<<a[1]<<endl;
    }
    cout << ((che<4&&che>0)?"NO":"YES")<<endl;
  }
  return 0;
}

C++: #include<string>
#include<vector>
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)


int main(){

	while(true){

		double xa,ya,xb,yb,xc,yc,xd,yd;
		cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
		if(cin.fail()) break;

		double a1=ya-yc;
		double b1=xc-xa;
		double c1=ya*(xa-xc)-xa*(ya-yc);
		double a2=yb-yd;
		double b2=xd-xb;
		double c2=yb*(xb-xd)-xb*(yb-yd);

		if((a1*xb+b1*yb+c1)*(a1*xd+b1*yd+c1)>0 && (a2*xa+b2*ya+c2)*(a2*xc+b2*yc+c2)<0) cout << "NO" << endl;
		else if((a1*xb+b1*yb+c1)*(a1*xd+b1*yd+c1)<0 && (a2*xa+b2*ya+c2)*(a2*xc+b2*yc+c2)>0) cout << "NO" << endl;
		else cout << "YES" << endl;

	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;
double x[4], y[4];
double ab, bc, cd, da, ac, bd;

double len(double x1, double y1, double x2, double y2)
{
    return sqrt(pow(x1-x2, 2.0) + pow(y1-y2, 2.0));
}

// Heron's Formula
double square(double a, double b, double c)
{
    double s = (a + b + c) / 2.0;
    return sqrt(s * (s-a) * (s-b) * (s-c));
}


int main(void)
{
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",x,y,x+1,y+1,x+2,y+2,x+3,y+3)) {
        ab = len(x[0],y[0],x[1],y[1]);
        bc = len(x[1],y[1],x[2],y[2]);
        cd = len(x[2],y[2],x[3],y[3]);
        da = len(x[3],y[3],x[1],y[1]);
        ac = len(x[0],y[0],x[2],y[2]);
        bd = len(x[3],y[3],x[1],y[1]);
        double s1,s2,s3,s4;
        s1 = square(ab, bd, da);
        s2 = square(cd, bd, bc);
        s3 = square(ac, cd, da);
        s4 = square(ab, bc, ac);
        double comp1;
        comp1 = (s1+s2) + (s3+s4);
        double mmax = max(max(s1,s2), max(s3,s4));

        if(fabs(mmax*2.0 - comp1) > 0.001)
            puts("YES");
        else
            puts("NO");
    }
    return 0;
}

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

const double EPS = 1e-10;
const double INF = 1e12;
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
double dot(P a, P b){
    return (conj(a)*b).X;
}
double 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; //ccw
    if(cross(b,c) <-EPS) return -1; //cw
    if(dot(b,c) < EPS) return +2; //c-a-b
    if(norm(b) < norm(c)) return -2; //a-b-c
    return 0; //a-c-b
}

int main(){
	double x[4], y[4];
	while(scanf("%lf,%lf", &x[0], &y[0])!=EOF){
		for(int i=1; i<4; i++){
			scanf(",%lf,%lf", &x[i], &y[i]);
		}
		VP quad(4);
		for(int i=0; i<4; i++){
			quad[i] = P(x[i], y[i]);
		}
		
		int judge=1;
		for(int i=0; i<4; i++){
			judge *= ccw(quad[i], quad[(i+1)%4], quad[(i+2)%4]);
		}
		if(judge==1){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
    return 0;
}

C++: #include <iostream>

using namespace std;

struct Vector {
        double x;
        double y;
};

bool is_c_inner(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) {
    Vector ab = Vector{xb - xa, yb - ya};
    Vector bc = Vector{xc - xb, yc - yb};

    Vector bd = Vector{xd - xb, yd - yb};
    Vector dc = Vector{xc - xd, yc - yd};

    Vector da = Vector{xa - xd, ya - yd};
    Vector ac = Vector{xc - xa, yc - ya};

    double cross_product_1 = ab.x * bc.y - ab.y * bc.x;
    double cross_product_2 = bd.x * dc.y - bd.y * dc.x;
    double cross_product_3 = da.x * ac.y - da.y * ac.x;

    return (cross_product_1 >=  0 && cross_product_2 >=  0 && cross_product_3 >=  0) ||
            (cross_product_1 <=  0 || cross_product_2 <=  0 && cross_product_3 <=  0);
}

int main() {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    string result;
    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) == 8) {
        if(is_c_inner( xa, ya, xb, yb, xc, yc, xd, yd)
                || is_c_inner(xb, yb, xc, yc, xd, yd, xa, ya)
                || is_c_inner(xc, yc, xd, yd, xa, ya, xb, yb)
                || is_c_inner(xd, yd, xa, ya, xb, yb, xc, yc)
                ) {
            result = "NO"; // no convex
        } else {
            result = "YES"; //convex
        }
        cout << result << endl;
    }
    return 0;
}