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>
#define EPS (1e-10)
#define equals(a,b)(fabs((a)-(b))<EPS)
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

struct Point {
	double x, y;
	Point(double x = 0, double y = 0) :x(x), y(y) {}
	Point operator*(double a) { return Point(a*x, a*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 norm() { return x*x + y*y; }
};
typedef vector<Point>Polygon;
struct Segment {
	Point p1, p2;
};
double cross(Point a, Point b) {
	return a.x*b.y - a.y*b.x;
}
double dot(Point a, Point b) {
	return a.x*b.x + a.y*b.y;
}
bool isPrallel(Segment s1, Segment s2) {
	return equals(cross(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}
bool isOrthogonal(Segment s1, Segment s2) {
	return equals(dot(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}
int contains(Polygon g, Point p) {
	int n = g.size();
	bool x = false;
	rep(i, n) {
		Point a = g[i] - p, b = g[(i + 1) % n] - p;
		if (abs(cross(a, b)) < EPS&&dot(a, b) < EPS)return 1;
		if (a.y > b.y)swap(a, b);
		if (a.y < EPS&&EPS<b.y&&cross(a, b)>EPS)x = !x;
	}
	return x ? 2 : 0;
}
int ccw(Point p0, Point p1, Point p2) {
	Point a = p1 - p0;
	Point b = p2 - p0;
	if (cross(a, b) > EPS)return 1;
	if (cross(a, b) < -EPS)return -1;
	if (dot(a, b) < -EPS)return 2;
	if (a.norm() < b.norm())return -2;
	return 0;
}
bool intersect(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);
}
bool intersect(Segment s1, Segment s2) {
	return intersect(s1.p1, s1.p2, s2.p1, s2.p2);
}
Point project(Segment s, Point p) {
	Point base = s.p2 - s.p1;
	double r = dot(p - s.p1, base) / base.norm();
	return s.p1 + base*r;
}
Point reflect(Segment s, Point p) {
	return p + (project(s, p) - p)*2.0;
}
bool isconvex(Polygon g) {
	rep(i, g.size())
		if (ccw(g[(i + g.size() - 1) % g.size()], g[i], g[(i + 1) % g.size()]) <= 0)
			return false;
	return true;
}
int main() {
	double x1, y1, x2, y2, x3, y3, x4, y4;
	while (~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)) {
		puts(isconvex({ {x1,y1},{x2,y2},{x3,y3},{x4,y4} }) ? "YES" : "NO");
	}
}

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

using namespace std;

double sinvalue( double v1x, double v1y, double v2x, double v2y )
{

	return ( v1x*v2y - v1y * v2x ) / sqrt( v1x * v1x + v1y * v1y ) * sqrt( v2x * v2x + v2y * v2y );
}


int main()
{
	double ax, ay, bx, by, cx, cy, dx, dy;
	double vecx_ab, vecy_ab, vecx_bc, vecy_bc, vecx_cd, vecy_cd, vecx_da, vecy_da;
	double sindab, sinabc, sinbcd, sincda;
	char tmp;
	while ( cin >> ax >> tmp >> ay >> tmp >> bx >> tmp >> by >> tmp >> cx >> tmp >> cy >> tmp >> dx >> tmp >> dy )
	{
		vecx_ab = bx - ax; vecy_ab = by - ay;
		vecx_bc = cx - bx; vecy_bc = cy - by;
		vecx_cd = dx - cx; vecy_cd = dy - cy;
		vecx_da = ax - dx; vecy_da = ay - dy;

		sindab = sinvalue( vecx_ab, vecy_ab, -vecx_da, -vecy_da );
		sinabc = sinvalue( vecx_bc, vecy_bc, -vecx_ab, -vecy_ab );
		sinbcd = sinvalue( vecx_cd, vecy_cd, -vecx_bc, -vecy_bc );
		sincda = sinvalue( vecx_da, vecy_da, -vecx_cd, -vecy_cd );

		if ( sindab > 0 && sinabc > 0 && sinbcd > 0 && sincda > 0 )
		{
			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) != 0) {
        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;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
#include <complex>
#include <climits>
using namespace std;

#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define EPS 1e-8

typedef complex<double> P;

double cross(P& a, P& b){
	return a.real()*b.imag() - a.imag()*b.real();
}
bool signeq(double a, double b){
	if( a+EPS<0.0 && b+EPS<0.0 ) return true;
	if( a-EPS>0.0 && b-EPS>0.0 ) return true;
	return false;
}
int main(){
	double x[4],y[4];
	while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",x,y,x+1,y+1,x+2,y+2,x+3,y+3)){
		int i;
		double s;
		for(i=0; i<4; i++){
			P A(x[(i+2)%4],y[(i+2)%4]), B(x[(i+1)%4],y[(i+1)%4]), C(x[i],y[i]);
			P AB = A-B;
			P BC = B-C;
			if( i==0 ){
				s = cross(AB,BC);
			}else{
				if( !signeq(s,cross(AB,BC)) ) break;
			}
		}
		puts(i==4?"YES":"NO");
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
double x[3],y[3];
bool isin(double px,double py){
    bool ok=true;
        for(int i=0;i<3;i++){
            bool plus=false;
            if(x[(i+1)%3]==x[(i+2)%3]){
                if(x[i]>x[(i+1)%3])plus=true;
            }
            else{
                double a,b;
                a=(x[i]-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
                b=(y[i]-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
                if(a>b)plus=true;
            }
            bool pnt=false;
            if(x[(i+1)%3]==x[(i+2)%3]){
                if(px>x[(i+1)%3])pnt=true;
            }
            else{
                double a,b;
                a=(px-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
                b=(py-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
                if(a>b)pnt=true;
            }
            if(pnt!=plus)ok=false;
        }
        if(ok)return true;
        else return false;
}
int main(){
	char z;
	double xx[4],yy[4];
	while(cin>>xx[0]>>z>>yy[0]){
		for(int i=1;i<4;i++)cin>>z>>xx[i]>>z>>yy[i];
		bool ok=true;
		for(int i=0;i<4;i++){
			for(int j=0;j<3;j++)x[j]=xx[j],y[j]=yy[j];
			if(isin(xx[3],yy[3]))ok=false;
			double kx=xx[3],ky=yy[3];
			for(int j=0;j<3;j++)xx[j+1]=x[j],yy[j+1]=y[j];
			xx[0]=kx,yy[0]=ky;
		}
		if(ok)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}