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

int main(){
  double x[4], y[4];
  double xa, ya, xb, yb;
  char c;
  int checkConvex;
  int i;

  while(cin>>x[0]>>c>>y[0]){
    for(i=1; i<4; i++) cin>>c>>x[i]>>c>>y[i];

    checkConvex=0;
    for(i=1; i<=4; i++){
      xa=x[i-1]-x[i%4]; ya=y[i-1]-y[i%4];
      xb=x[(i+1)%4]-x[i%4]; yb=y[(i+1)%4]-y[i%4];
      if(xa*yb-ya*xb>0) checkConvex++;
      else checkConvex--;
    }
    if(checkConvex==4 || checkConvex==-4) printf("YES\n");
    else printf("NO\n");
  }

  return 0;
}

C++: 
#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

int main () {
	double xa, ya, xb, yb, xc, yc, xd, yd, xe, ye;
	double tac, tbd, sac, sbd;
	char c[10000];
	int i;
	while(scanf("%s",&c)!=EOF) {
		xa=atof(strtok ( c, "," ));
		ya = atof ( strtok ( NULL, "," ) ); 
		xb = atof ( strtok ( NULL, "," ) ); 
		yb = atof ( strtok ( NULL, "," ) ); 
		xc = atof ( strtok ( NULL, "," ) ); 
		yc = atof ( strtok ( NULL, "," ) ); 
		xd = atof ( strtok ( NULL, "," ) ); 
		yd = atof ( strtok ( NULL, "," ) ); 
		sac = ( yc - ya ) / ( xc - xa );
		tac = ya - xa*sac;
		sbd = ( yd - yb ) / ( xd - xb );
		tbd = yb - xb*sbd;
		xe = ( tac - tbd ) / ( sbd - sac );
		ye = xe*sac + tac;
		if(( ( xa <= xe&&xe <= xc ) || ( xc <= xe&&xe <= xa ) ) && ( ( ya <= ye&&ye <= yc ) || ( yc <= ye&&ye <= ya ) )) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
		//printf ( "%f %f\n", xb, yb );
	}
	return 0;
}

C++: #include<stdio.h>

int R_1_or_L_2(
    double x1,double y1,
    double x2,double y2,
    double x3,double y3){
  int i;

  if(x1==x2)
    return (y1<y2)?
      (x3>x1?1:2):
      (x3<x1?1:2);
  if(y1==y2)
    return (x1<x2)?
      (y3<y1?1:2):
      (y3>y1?1:2);
  if(y3<(x3-x1)*(y2-y1)/(x2-x1)+y1)
    return (x1<x2)?1:2;
  return (x2<x1)?1:2;
}

int main(void){
  double x[4],y[4];
  char hoge;

  for(;scanf("%lf%c%lf%c%lf%c%lf%c%lf%c%lf%c%lf%c%lf",
        &x[0],&hoge,&y[0],&hoge,
        &x[1],&hoge,&y[1],&hoge,
        &x[2],&hoge,&y[2],&hoge,
        &x[3],&hoge,&y[3])==15;){

    if(
        (R_1_or_L_2(x[0],y[0],x[1],y[1],x[2],y[2])
         ==
         R_1_or_L_2(x[0],y[0],x[2],y[2],x[3],y[3]))
        &&
        (R_1_or_L_2(x[0],y[0],x[2],y[2],x[3],y[3])
         ==
         R_1_or_L_2(x[1],y[1],x[2],y[2],x[3],y[3]))
      )
      printf("YES\n");
    else
      printf("NO\n");
  }

  return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> P;

// real -> X
// imag -> Y
bool isIntersect(P p1, P p2, P p3, P p4){
	return 	(
			((p1.real() - p2.real()) * (p3.imag() - p1.imag()) + (p1.imag() - p2.imag()) * (p1.real() - p3.real())) *
			((p1.real() - p2.real()) * (p4.imag() - p1.imag()) + (p1.imag() - p2.imag()) * (p1.real() - p4.real()))
			) > 0.0;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	double xa, ya, xb, yb, xc, yc, xd, yd;
	// 0 0 1 0 1 1 0 1
	char c0;
	while(cin >> xa >> c0 >> ya >> c0){
		cin >> xb >> c0 >> yb >> c0;
		cin >> xc >> c0 >> yc >> c0;
		cin >> xd >> c0 >> yd;

		P a(xa, ya);
		P b(xb, yb);
		P c(xc, yc);
		P d(xd, yd);

		cout << ((isIntersect(a, c, b, d) || isIntersect(b, d, a, c)) ? "NO" : "YES") << endl;
	}

	return 0;
}

C++: #include <stdio.h>

int
main(void)
{
	auto deg = [](double ax, double ay, double bx, double by,
				  double cx, double cy)  -> double {
		    double abx = bx - ax;
		    double aby = by - ay;
		    double acx = cx - ax;
		    double acy = cy - ay;
		 
		    return (abx * acy  -acx * aby);
		};

	char line[80];

	double xa, ya, xb, yb, xc, yc, xd, yd;

	while (true) {
		if (fgets(line, sizeof line, stdin) == NULL) {
			break;
		}
		if (sscanf(line, "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,",
				   &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != 8) {
			break;
		}

		double d0 = deg(xa, ya, xb, yb, xd, yd);
		double d1 = deg(xb, yb, xc, yc, xa, ya);
		double d2 = deg(xc, yc, xd, yd, xb, yb);
		double d3 = deg(xd, yd, xa, ya, xc, yc);

        if ((d0 < 0 && d1 < 0 && d2 < 0 && d3 < 0) ||
	        (d0 > 0 && d1 > 0 && d2 > 0 && d3 > 0)) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
	}

	return 0;
}

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 * 10;
    return (double)round(d * l) / l / 10;
}

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>
#include <cstdio>
using namespace std;

double cross(double x1, double y1, double x2, double y2, double x3, double y3) {
	double xx1 = x2-x1, yy1 = y2-y1;
	double xx2 = x3-x1, yy2 = y3-y1;
	return (xx1*yy2 - xx2*yy1);
}

int main() {
	double xa,xb,xc,xd,ya,yb,yc,yd;
	while (scanf(
			"%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
			&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) == 8) {
		double p = cross(xa, ya, xb, yb, xc, yc);
		bool convex = true;
		if (p*cross(xb, yb, xc, yc, xd, yd) < 0.0) convex = false;
		if (p*cross(xc, yc, xd, yd, xa, ya) < 0.0) convex = false;
		if (p*cross(xd, yd, xa, ya, xb, yb) < 0.0) convex = false;

		cout << (convex ? "YES" : "NO") << endl;
	}
	return 0;
}

C++: #include <cstdio>

using namespace std;

int main(){
  float p[4][2];
  while(scanf("%f,%f,%f,%f,%f,%f,%f,%f"
	      ,&p[0][0],&p[0][1],&p[1][0],&p[1][1],&p[2][0],&p[2][1],&p[3][0],&p[3][1])>0){
    for(int i=0;i<4;i++){
      int n,m;
      float a1,a2,b1,b2,xp,yp,A,B;
      a1=p[(i+1)%4][0]-p[i%4][0];
      a2=p[(i+1)%4][1]-p[i%4][1];
      b1=p[(i+3)%4][0]-p[i%4][0];
      b2=p[(i+3)%4][1]-p[i%4][1];
      xp=p[(i+2)%4][0]-p[i%4][0];
      yp=p[(i+2)%4][1]-p[i%4][1];
      A=(b1*yp-b2*xp)/(a2*b1-a1*b2);
      B=(a2*xp-a1*yp)/(a2*b1-a1*b2);
      if(A+B<1&&A>0&&B>0){
	printf("NO\n");
	break;
      }
      if(i==3) printf("YES\n");
    }
  }
    return 0;
  }