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<cmath>
using namespace std;
struct Point { long double px, py; };
Point Minus(Point p1, Point p2) {
	Point p3;
	p3.px = p1.px - p2.px;
	p3.py = p1.py - p2.py;
	return p3;
}
long double norm(const Point& a) { return a.px * a.px + a.py * a.py; }
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
int ccw(Point p0, Point p1, Point p2) {
	Point a = Minus(p1, p0), b = Minus(p2, p0);
	if (crs(a, b) > 1e-10) return 1;
	if (crs(a, b) < -1e-10) return -1;
	if (dot(a, b) < -1e-10) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
bool is_convex(vector<Point> v) {
	if (v.size() < 3) return false;
	int s = -3;
	for (int i = 0; i < v.size(); i++) {
		int r = ccw(v[i], v[(i + v.size() - 1) % v.size()], v[(i + 1) % v.size()]);
		if (abs(r) == 1 && s == -3) s = r;
		if (s * r == -1) return false;
	}
	return true;
}
int main() {
	vector<Point>V; Point C; char c;
	while (cin >> C.px >> c >> C.py) {
		V.clear();
		V.push_back(C);
		for (int i = 0; i < 3; i++) {
			cin >> c >> C.px >> c >> C.py;
			V.push_back(C);
		}
		bool G = is_convex(V);
		if (G == true)cout << "YES" << endl;
		if (G == false)cout << "NO" << endl;
	}
	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;
}

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./(double)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) {
    double abp = area(A,B,P);
    double bcp = area(B,C,P);
    double cap = area(C,A,P);
    double abc = area(A,B,C);
    if (abs(abp + bcp + cap - abc) < 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 <complex>
using namespace std;
typedef complex<double> P;
const double precision = 1e-10;
bool eql(double a, double b) { return abs(a - b) < precision; }
double cross(P a, P b) { return a.real()*b.imag() - b.real()*a.imag(); }
bool rightp(P start, P end, P p) { return cross(end-start, p-start) < precision; }
bool convexp(P a, P b, P c, P d) {
  return (rightp(a, c, b) && rightp(b, d, c) && rightp(c, a, d) && rightp(d, b, a));
}

int main(int argc, char **argv)
{
  double xa, ya, xb, yb, xc, yc, xd, yd;
  char c;
  for (;;) {
    cin >> xa >> c >> ya >> c >> xb >> c >> yb >> c >> xc >> c >> yc >> c >> xd >> c >> yd;
    if (cin.eof())
      break;

    if (convexp(P(xa, xa), P(xb, yb), P(xc, yc), P(xd, yd)))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

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

#define scanf scanf_s

struct p {
	double x;
	double y;
};

int check(struct p a,struct p b,struct p c,struct p d) {
	if (((a.x-b.x)*(c.y-a.y)+(a.y-b.y)*(a.x-c.x)) *
		((a.x-b.x)*(d.y-a.y)+(a.y-b.y)+(a.x-d.x))) {
		return 1;
	}
	return 0;
}

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

		if (check(a,c,b,d) && check(b,d,a,c)) {
			cout << "NO";
		}else {
			cout << "YES";
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

typedef struct{
  double x;
  double y;
}Point;


const int INF = (1<<25);
Point p[4];
double m[4];

void make(){
  for(int i = 0; i < 4; i++){
    if(p[i].x - p[i+1].x) m[i] = (p[i].y - p[i+1].y)/ (p[i].x - p[i+1].x);
    else m[i] = INF;
  }
}

int solve(){
  make();
  if(m[0] == m[2] || m[1] == m[3]) return 1;
  return 0;
}

int main(){
  int status = 0;
  while(1){
    char t;
    for(int i = 0; i < 3; i++) if(!(cin >> p[i].x >> t >> p[i].y >> t)) status = 1;
    if(status) break;
    if(!(cin >> p[3].x >> t >> p[3].y)) status = 1;
    if(status) break;
    if(solve()) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

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

using namespace std;

typedef complex<double> P;

#define X real()
#define Y imag()

//¼üp1p3Æüªp2p4Ìð·»è
//1ÂÌüªp1p3ÆA»êÉÜÜêÈ¢2_p2,p4ÉÂ¢ÄAp1p3Æp1p2Ap1p3Æp1p4A»ê¼êÉÂ¢ÄOÏðßÄ»ÌÏðæé
//OÏÌ³ÍxNgÌÈ·pÌsinÉËéÌÅAp2,p4Ì»ê¼êªp1p3Ì¶É é©EÉ é©ªí©é
//³Èçð·µÄ¢È¢AÈçð·µÄ¢éA0Èç¼üã
double is_intersected(P p1,P p2,P p3,P p4) {

  return (((p3.X-p1.X)*(p2.Y-p1.Y)-(p3.Y-p1.Y)*(p2.X-p1.X))*((p3.X-p1.X)*(p4.Y-p1.Y)-(p3.Y-p1.Y)*(p4.X-p1.X)));

}

int main() {

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

  //¼üACÆüªBDA é¢ÍüªACÆ¼üBDªð·µÄ¢êÎÊp`
  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(is_intersected(a,b,c,d)>0.0 || is_intersected(b,a,d,c)>0.0) cout << "NO" << endl;

    else cout << "YES" << endl;

  }

  return 0;

}