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 <bits/stdc++.h>
using namespace std;

using T = long double;
const T INF = 1e10;
const T EPS = 1e-10;
const T PI = acos(-1.0);
T torad(int deg) {return (T)(deg) * PI / 180;}
T todeg(T ang) {return ang * 180 / PI;}
template <typename T> inline bool eq(T p, T q) { return abs(p - q) < EPS; }
inline int sgn(T x) { return (EPS < x) - (x < -EPS); }

/* Point */
using Point = complex<T>;
#define x real()
#define y imag()
inline T dot(Point v, Point w) { return (conj(v) * w).x; }
inline T cross(Point v, Point w) { return (conj(v) * w).y; }
inline T orient(Point a, Point b, Point c) { return cross(b - a, c - a); }
inline Point unit(Point v) { return v / abs(v); }
inline Point rot(Point p, T a) { return p * polar(T(1), a); }
inline Point rot90(Point p) { return {-p.y, p.x}; }
bool cmpX(const Point& a, const Point& b) { return a.x != b.x ? a.x < b.x : a.y < b.y; }
bool cmpY(const Point& a, const Point& b) { return a.y != b.y ? a.y < b.y : a.x < b.x; }
namespace std {
    istream& operator>>(istream &is, Point &p) { T xx, yy; is >> xx >> yy; p = Point(xx, yy); return is; }
    bool operator < (const Point &a, const Point &b) { return cmpX(a, b); }
}

/* Line */
struct Line : array<Point, 2> {
    Point v; T c;
    Line() = default;
    explicit Line(Point a, Point b) : array<Point, 2>({a, b}), v(b - a), c(cross(v, a)) {}
    T side(Point p) { return cross(v, p) - c; }
    Point proj(Point p) { return p - rot90(v) * side(p) / norm(v); }
    Point refl(Point p) { return p - rot90(v) * T(2) * side(p) / norm(v); }
    bool onLine(Point p) { return abs(side(p)) < EPS; }
    bool onSegment(Point p) { return onLine(p) && dot(this->operator[](0) - p, this->operator[](1) - p) <= EPS; }
    friend istream& operator>>(istream &is, Line &l) { Point p, q; is >> p >> q; l = Line(p, q); return is; }
    friend ostream& operator<<(ostream &os, const Line &l) { return os << '{' << l[0] << ", " << l[1] << '}'; }
};

/* Circle */
struct Circle : Point {
    T r;
    Circle() = default;
    Circle(Point p, T r) : Point(p), r(r) {}
    friend istream& operator>>(istream &is, Circle& c) { Point p; T r; is >> p >> r; c = Circle(p, r); return is; }
    friend ostream& operator<<(ostream &os, const Circle &c) { return os << '(' << c.x << ", " << c.y << ", " << c.r << ')'; }
};

bool is_convex(vector<Point> &ps) {
    bool pos = false, neg = false;
    for (int i = 0, n = ps.size(); i < n; ++i) {
        int o = orient(ps[i], ps[(i + 1) % n], ps[(i + 2) % n]);
        if (o > 0) pos = true;
        if (o < 0) neg = true;
    }
    return !(pos && neg);
}

int main() {
    string s;
    while (getline(cin, s)) {
        s = "," + s;
        stringstream ss(s);
        vector<Point> ps(4);
        for (int i = 0; i < 4; ++i) {
            char c;
            T xx, yy;
            ss >> c >> xx >> c >> yy;
            ps[i] = Point(xx, yy);
        }
        cout << (is_convex(ps) ? "YES" : "NO") << endl;
    }
}

C++: #include <complex>
#include <stdio.h>
#include <math.h>
using namespace std;

// _ÀWð^Æ·é
typedef complex<double> P;
// ÎÌè`
#define PI 3.1415926535898

// e·éë·Ã
#define EPS (1e-10)
//XYÀW
#define X real()
#define Y imag()

//QÂÌdouble^Ìlªµ¢©Ç¤©
bool equal(double a, double b){
	return (fabs( a-b ) < EPS)? true : false ;
}
	
// Op`NX
class Triangle{

private:
	//Op`ÌR_ÌÀW
	P a, b, c;
	//Op`ÌRÓÌ·³
	double edgeA,edgeB,edgeC;
	//Op`ÌRpÌå«³(WA)
	double angleA,angleB,angleC;
	//]·è©çRÂÌpxðßéÖ
	double LawOfCosines(double a,double b, double c){
		return acos( (b*b+c*c-a*a) / (2.0*b*c) );
	}
	

public:
	//RXgN^(RÂÌ_ÆÓÆpxðú»)
	Triangle(P p1, P p2, P p3){
		a = p1;
		b = p2;
		c = p3;
		edgeB = abs(c-a);
		edgeA = abs(b-c);
		edgeC = abs(a-b);
		angleA = LawOfCosines(edgeA,edgeB,edgeC);
		angleB = LawOfCosines(edgeB,edgeC,edgeA);
		angleC = LawOfCosines(edgeC,edgeA,edgeB);
	}
	double getAngleA(){//pAÌpxðÏ¦·
		return angleA;
	}
	double getAngleB(){//pBÌpxðÏ¦·
		return angleB;
	}
	double getAngleC(){//pCÌpxðÏ¦·
		return angleC;
	}
};

int main(){
	double xa, xb, xc, xd, ya, yb, yc, yd, angleA, angleB, angleC, angleD;

	while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF ){
		P a( xa , ya );
		P b( xb , yb );
		P c( xc , yc );
		P d( xd , yd );
		Triangle Tr1(a,b,c);
		Triangle Tr2(a,d,c);
		angleA = Tr1.getAngleA() + Tr2.getAngleA();
		angleC = Tr1.getAngleC() + Tr2.getAngleC();
		angleB = Tr1.getAngleB() ;
		angleD = Tr2.getAngleB() ;
		
		if( angleA<PI && angleB<PI && angleC<PI && angleD<PI){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

	return 0;
}

C++: //Is it Convex?
#include<bits/stdc++.h>
using namespace std;

typedef complex<double> P;
typedef vector<P> G;
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
#define prev(P, i) P[(i+P.size()-1)%P.size()]

inline double cross(const P &a, const P &b){return imag(conj(a)*b);}
inline double dot(const P &a, const P &b){return real(conj(a)*b);}

int ccw(P a, P b, P c){
  b-=a; c-=a;
  if(cross(b, c) > 0) return +1;
  if(cross(b, c) < 0) return -1;
  if(dot(b, c) < 0) return +2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}
bool isconvex(const G &p){
  for(int i=0; i<p.size(); ++i)
    if(ccw(prev(p, i), curr(p, i), next(p, i)) < 0)return false;
  return true;
}

int main(){
  char t;
  P a, b, c, d;
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a.real(), &a.imag(), &b.real(), &b.imag(), &c.real(), &c.imag(), &d.real(), &d.imag())!=EOF){
    G g;
    g.clear();
    g.push_back(a); g.push_back(b); g.push_back(c); g.push_back(d);
    if(isconvex(g)) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  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 = b - c;

	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;
    }
}