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<cmath>
int main()
{
	while (true)
	{
		double xa, ya, xb, yb, xc, yc, xd, yd;
		char foo;
		std::cin >> xa >> foo >> ya >> foo >> xb >> foo >> yb >> foo >> xc >> foo >> yc >> foo >> xd >> foo >> yd;
		if (std::cin.eof())
		{
			break;
		}
		const long double A_C = std::hypot(xa - xc, ya - yc);
		const long double B_D = std::hypot(xb - xd, yb - yd);
		const long double A_BD = std::abs((yd - yb) * (xa - xd) - (xd - xb) * (ya - yd)) / std::hypot(yd - yb, xd - xb);
		const long double B_AC = std::abs((yc - ya) * (xb - xc) - (xc - xa) * (yb - yc)) / std::hypot(yc - ya, xc - xa);
		std::cout << (A_C > A_BD && B_D > B_AC ? "YES" : "NO") << std::endl;
	}
	return 0;
}

C++: #include<iostream>
#include<float.h>
using namespace std;

int main(){
    double pos[4][2];
    double slope[4];
    bool zero[4];
    double temp;
    int lors;
    bool result;
    int i, j;
    char comma;
    while(cin >> pos[0][0]){
        cin >> comma >> pos[0][1];
        for(i=1;i<4;i++){
            for(j=0;j<2;j++){
                cin >> comma >> pos[i][j];
            }
        }
        for(i=0;i<4;i++){
            temp = pos[i%4][0] - pos[(i+1)%4][0];
            if(temp == 0){
                slope[i] = DBL_MAX;
                zero[i] = true;
            }else{
                slope[i] = (pos[i%4][1] - pos[(i+1)%4][1])/temp;
                zero[i] = false;
            }
        }
        result = true;
        for(i=0;i<2;i++){
            cout << endl;
            if(slope[0] > slope[1]){
                lors = 0;
            }else{
                lors = 1;
            }
            for(j=1;j<4;j++){
                if(slope[j%4] > slope[(j+1)%4] && !lors){
                    result = false;
                    break;
                }else if(slope[j%4] < slope[(j+1)%4] && lors){
                    result = false;
                    break;
                }else{
                    lors = 1 - lors;
                }
            }
            for(j=0;j<4;j++){
                if(zero[j]){
                    slope[j] = DBL_MIN;
                }
            }

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

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

using namespace std;
typedef pair<double, double> P;

double Helon(P pa, P pb, P pc)
{
	double a, b, c;
	a = sqrt((pb.first - pa.first) * (pb.first - pa.first) + (pb.second - pa.second) * (pb.second - pa.second));
	b = sqrt((pc.first - pb.first) * (pc.first - pb.first) + (pc.second - pb.second) * (pc.second - pb.second));
	c = sqrt((pa.first - pc.first) * (pa.first - pc.first) + (pa.second - pc.second) * (pa.second - pc.second));
	double s = (a + b + c) / 2;
	return(sqrt(s * (s - a) * (s - b) * (s - c)));
}

void solve()
{
	vector<P> p(4);
	while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &p[0].first, &p[0].second, &p[1].first, &p[1].second, &p[2].first, &p[2].second, &p[3].first, &p[3].second))
	{
		double S1, S2;
		S1 = Helon(p[0], p[1], p[2]);
		S1 += Helon(p[0], p[2], p[3]);

		S2 = Helon(p[0], p[1], p[3]);
		S2 += Helon(p[1], p[2], p[3]);
		if(fabs(S1 - S2) < 1e-10)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;

//三角形面積（三点から）
double smen(double x1, double y1, double x2, double y2, double x3, double y3){
double wkk;
	
	wkk =((x3-x2) * (y1-y2) - (x1-x2) * (y3-y2) )* 0.5;
	if(wkk < 0) wkk *= -1;
	return wkk;
}


int main(void){

double xa,xb,xc,xd,ya,yb,yc,yd;
int cnt=0;
char k;
	while(!cin.eof() && cnt < 50){
		cin >> xa >> k >> ya >> k >> xb >> k >> yb >> k
		    >> xc >> k >> yc >> k >> xd >> k >> yd ;
		if(cin.eof()) break;
		 
		double s1 = smen(xa,ya,xb,yb,xc,yc);
		double s1b= smen(xa,ya,xc,yc,xd,yd);
		double s2 = smen(xa,ya,xb,yb,xd,yd);
		double s2b= smen(xb,yb,xc,yc,xd,yd);
		if(s1+s1b==s2+s2b) cout << "YES" << endl;
		else  cout <<  "NO" << endl;
//		cin.clear();
		cnt++;
	}
	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 = b - c;

	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 cnt, ans = 0, count = 0;

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

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

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<double, double> pdd;

int main()
{
    double xa, ya, xb, yb, xc, yc, xd, yd;
    char c;
    while (cin >> xa >> c >> ya >> c >> xb >> c >> yb >> c >> xc >> c >> yc >> c >> xd >> c >> yd)
    {
        deque<pdd> q;
        q.push_back(pdd(xa, ya));
        q.push_back(pdd(xb, yb));
        q.push_back(pdd(xc, yc));
        q.push_back(pdd(xd, yd));

        bool flag = 0;

        rep(i, 4)
        {
            vector<pdd> v(3);

            rep(k, 3)
            {
                v[k].first = q[3].first - q[k].first;
                v[k].second = q[3].second - q[k].second;
            }

            auto v_pro = [](pdd p, pdd q) {
                return p.first * q.second - p.second * q.first;
            };

            if ((v_pro(v[0], v[1]) > 0 && v_pro(v[1], v[2]) > 0 && v_pro(v[2], v[0]) > 0) || (v_pro(v[0], v[1]) < 0 && v_pro(v[1], v[2]) < 0 && v_pro(v[2], v[0]) < 0))
                flag = 1;

            q.push_back(q.front());
            q.pop_front();
        }

        if (flag == 1)
            OP("NO");
        else
            OP("YES");
    }

    return 0;
}