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 db = double;
using ll = long long;
using vi = vector <int>;
#define op operator
#define pb push_back

struct poi {
	db x, y;
	poi op -(poi p) {
		return {x - p.x, y - p.y};
	}
	db cross(poi p) {
		return x * p.y - y * p.x;
	}
}p[4];
db xmul(poi a, poi b, poi c) {
	return (b - a).cross(c - a);
}

int main() {
	ios :: sync_with_stdio(0);

	while(cin >> p[0].x) {
		char c; cin >> c >> p[0].y;
		for(int i = 1; i < 4; i ++)
			cin >> c >> p[i].x >> c >> p[i].y;
		int c1 = 0, c2 = 0;
		for(int i = 0; i < 4; i ++)
			if(xmul(p[i], p[(i + 1) % 4], p[(i + 2) % 4]) > 0)
				c1 ++;
			else
				c2 ++;
		cout << (!c1 || !c2 ? "YES" : "NO") << '\n';
	}
	
	return 0;
}

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()]) != -1)
			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({ {x4,y4},{x3,y3},{x2,y2}, {x1,y1} }) ? "YES" : "NO");
	}
}

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

using namespace std;

typedef complex<double> P;

#define EPS (1.0e-11)
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

double cross(P a, P b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}


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

    while (cin >> x[0] >> comma >> y[0]) {
        bool clock;

        for (int i = 1; i < 4; i++) 
            cin >> comma >> x[i] >> comma >> y[i];

        if (cross(P(x[1] - x[0], y[1] - y[0]), 
                  P(x[2] - x[0], y[2] - y[0])) > EPS)
            clock = true;
        else
            clock = false;

        bool flag = true;
        for (int i = 1; i < 4; i++) {
            if (clock) {
                if (cross(P(x[(i + 1) % 4] - x[i], y[(i + 1) % 4] - y[i]), 
                          P(x[(i + 2) % 4] - x[i], y[(i + 2) % 4] - y[i])) < -EPS) {
                    flag = false;
                    break;
                }
            }
            else {
                if (cross(P(x[(i + 1) % 4] - x[i], y[(i + 1) % 4] - y[i]), 
                          P(x[(i + 2) % 4] - x[i], y[(i + 2) % 4] - y[i])) > EPS) {
                    flag = false;
                    break;
                }
            }
        }
        if (flag)
            cout << "YES" << endl;
        else 
            cout << "NO" << endl;
    }
    
    return 0;
}

C++: #include <stdio.h>
#define S(x,y,a,b,l,r) x*b+a*r+l*y-y*a-l*b-r*x
int main() {double a,b,c,d,o,p,q,r;while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&o,&p,&q,&r)!=EOF) {if (S(a,b,c,d,o,p)==S(c,d,o,p,q,r)==S(o,p,q,r,a,b)==S(q,r,a,b,c,d)) puts("YES"); else puts("NO");} return 0;}

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

int main(){
	char trash;
	double x[4], y[4];
	while(cin >> x[0] >> trash >> y[0]){
		double a,b,c,d,e,f,t;
		for(int i = 1; i < 4; i++){
			cin >> trash >> x[i] >> trash >> y[i];
		}
		a = y[2]-y[0];
		b = -x[2]+x[0];
		e = -1*(y[0]*(x[2]-x[0])-x[0]*(y[2]-y[0]));
		c = y[3]-y[1];
		d = -x[3]+x[1];
		f = -1*(y[1]*(x[3]-x[1])-x[1]*(y[3]-y[1]));
		t = (e*d-b*f)/(a*d-b*c);
		if(x[2] < x[0]){
			swap(x[0],x[2]);
		}
		if(x[3] < x[1]){
			swap(x[1],x[3]);
		}
		if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}