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<cstdio>
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#define EPS 1e-10
#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
#define pb push_back
#define pop pop_back
using namespace std;
typedef pair<double,int> Pos;
 
struct Point{
  double x,y;
  Point(double x=0,double y=0):x(x),y(y){}
  Point operator + (Point p){return Point(x+p.x,y+p.y);}
  Point operator - (Point p){return Point(x-p.x,y-p.y);}
  Point operator * (Point p){return Point(x*p.x,y*p.y);}
  Point operator / (Point p){return Point(x/p.x,y/p.y);}
  double dot(Point p){
    return x*p.x+y*p.y;
  }
  double cross(Point p){
    return x*p.y-y*p.x;
  }
  double norm(){
    x*x+y*y;
  }
  double abs(){
    return sqrt(norm());
  }
  bool operator < (const Point &p) const{
    return x != p.x ? x<p.x:y<p.y;
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};
int ccw(Point p1,Point p2,Point p3){
  Point a = p2-p1;
  Point b = p3-p1;
  if(a.cross(b) > EPS)return COUNTER_CLOCKWISE;
  if(a.cross(b) < -EPS)return CLOCKWISE;
  if(a.dot(b) < -EPS)return ONLINE_BACK;
  if(a.norm() < b.norm())return ONLINE_FRONT;
  return ON_SEGMENT;
}
 
bool cmp_x(const Point& p,const Point& q){
  if(p.x!=q.x)return p.x<q.x;
    return p.y<q.y;
}
 
vector<Point> convex_hull(Point* ps,int n){
  sort(ps,ps+n,cmp_x);
  int k=0;
  vector<Point> qs(n*2);
  for(int i=0;i<n;i++){
    while(k>1 && (qs[k-1]-qs[k-2]).cross(ps[i]-qs[k-1])<=0)k--;
    qs[k++] = ps[i];
  }
  for(int i=n-2,t=k;i>=0;i--){
    while(k>t && (qs[k-1]-qs[k-2]).cross(ps[i]-qs[k-1])<=0)k--;
    qs[k++] = ps[i];
  } 
  qs.resize(k-1);
  return qs;
}
 
bool isIntersect(Point p1,Point p2,Point p3,Point p4){
  return (ccw(p1,p2,p3)*ccw(p1,p2,p4)<=0 && ccw(p3,p4,p1)*ccw(p3,p4,p2)<=0);
}
 
 
int main(){
  Point p1,p2,p3,p4;
  Point poly[5];
   
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&p1.x,&p1.y,&p2.x,&p2.y,&p3.x,&p3.y,&p4.x,&p4.y) != EOF){
    double sum=0;   
    poly[0] = p1;poly[1] = p2;poly[2] = p3;poly[3]=p4;poly[4]=p1;
 
 
    vector<Point> pos = convex_hull(poly,4);
 
    if(pos.size() <= 3)cout << "NO" << endl;
    else cout << "YES" << endl;
 
 
  }
  return 0;
}

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

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() {

	P a, b, c, d;
	char dummy;

	while ( cin >> a.x >> dummy >> a.y >> dummy >> b.x >> dummy >> dummy >> b.y >> dummy >> c.x >> dummy >> c.y >> dummy >> d.x >> dummy >> d.y ) {
		int count = 0, ans = 0;

		count += ccw(a, b, c);
		ans += abs(ccw(a, b, c));
		count += ccw(b, c, d);
		ans += abs(ccw(b, c, d));
		count += ccw(c, d, a);
		ans += abs(ccw(c, d, a));
		count += ccw(d, a, b);
		ans += abs(ccw(d, a, b));

		if(abs(count) == ans) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

#define X first
#define Y second
#define dis(a, b) (b.X - a) * (b.X - a) + (b.Y - a) * (b.Y - a)

using namespace std;

double cross(pair<double, double> lineA, pair<double, double> lineB){
	return (lineA.X * lineB.Y - lineB.X * lineA.Y) / sqrt(dis(0, lineB));
}

int main(){
	pair<double, double> pointA, pointB, pointC, pointD;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &pointA.X, &pointA.Y, &pointB.X, &pointB.Y, &pointC.X, &pointC.Y, &pointD.X, &pointD.Y) != EOF){
		vector<pair<double, double> > point;
		point.push_back(pointA);
		point.push_back(pointB);
		point.push_back(pointC);
		point.push_back(pointD);
		int count = 0;
		for(int i = 0; i < point.size(); i++){
			pair<double, double> lineA(point[(i + 1) % 4].X - point[i].X, point[(i + 1) % 4].Y - point[i].Y); 
			pair<double, double> lineB(point[(i + 2) % 4].X - point[i].X, point[(i + 2) % 4].Y - point[i].Y);
			cross(lineA, lineB) > 0 ? count++ : count--;
		}

		cout << (count == 4 || count == -4 ? "YES" : "NO") << 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) + pow(y1-y2, 2));
}

// 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.00001)
            puts("YES");
        else
            puts("NO");
    }
    return 0;
}

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

int main()
{
	const double PI = acos(-1);
	double x[4], y[4];
	char c;

	while (cin >> x[0] >> c >> y[0] >> c >> x[1] >> c >> y[1] >> c
				>> x[2] >> c >> y[2] >> c >> x[3] >> c >> y[3]) {

		bool f = 1;

		for (int i = 0; i < 4; i++) {
			int j = (i + 1) % 4, k = (i + 2) % 4;
			double t = atan2(y[k] - y[j], x[k] - x[j]) - atan2(y[j] - y[i], x[j] - x[i]);

			if (t < -PI)
				t += PI * 2;
			else if (t > PI)
				t -= PI * 2;

			if (!(t >= 0)) {
				f = 0;
				break;
			}
		}

		if (f)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}