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>
using namespace std;

double crs(double x1, double y1, double x2, double y2) {
    return x1 * y2 - y1 * x2;
}

int main() {
    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]) {
        int sum = 0;
        for (int i=0; i<4; ++i) {
            sum += 0 < crs(x[(i+1)%4] - x[i], y[(i+1)%4] - y[i], x[(i+2)%4] - x[(i+1)%4], y[(i+2)%4] - y[(i+1)%4]);
        }
        cout << (sum % 4 == 0 ? "YES" : "NO") << endl;
    }
    return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

struct point
{
	double x;
	double y;
	point()
	{
		x = 0.0;
		y = 0.0;
	}
	point(double a, double b)
	{
		x = a;
		y = b;
	}
};
//直線-線分の交差判定
//s
bool c_s_cross(point s, point t, point u, point v)
{
	double tc = (s.x - t.x)*(u.y - s.y) + (s.y - t.y)*(s.x - u.x);
	double td = (s.x - t.x)*(v.y - s.y) + (s.y - t.y)*(s.x - v.x);

	if(tc*td < 0)
	{
		return true;
	}
	else
	{
		return false;
	}
}

bool judge(point a, point b, point c, point d)
{
	if(c_s_cross(a, c, b, d) && c_s_cross(b, d, a, c))
	{
		return true;
	}
	else
	{
		return false;
	}
}

int main()
{
	point a, b, c, d;

	while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.x ,&a.y ,&b.x ,&b.y ,&c.x ,&c.y ,&d.x ,&d.y))
	{
		//printf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",a.x ,a.y ,b.x ,b.y ,c.x ,c.y ,d.x ,d.y);
		cout << (judge(a, b, c, d)?"YES":"NO") << endl;
	}
}

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

using namespace std;

#define EPS 1e-5

struct point{
	double x;
	double y;
};

struct line{
	double a; // 傾き
	double b; // y切片
};

istream& operator >> ( istream& s , point& p );
bool get_line( const point& a , const point& b , line *a_b );
bool get_position( const point& a , const point& b , const point& c );
bool get_cross( const point& a , const point& b , const point& c , const point& d );
bool get_convex( const point& a , const point& b , const point& c , const point& d );
bool get_convex_new( const point& a , const point& b , const point& c , const point& d );

int main(void)
{
	point a, b, c, d;

	while(1)
	{
		cin >> a >> b >> c >> d;
		if( cin.eof() ) break;
		if( get_convex_new( a , b , c , d ) ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

istream& operator >> ( istream& s , point& p )
{
	return s >> p.x >> p.y;
}

bool get_line( const point& a , const point& b , line *a_b )
{
	if( fabs(a.x - b.x) < EPS ) return false;
	else{
		a_b->a = (a.y - b.y)/(a.x - b.x);
		a_b->b = a.y - (a.x * a_b->a);
		return true;
	}
}

bool get_position( const point& a , const point& b , const point& c )
{
	// 点a, bを通る直線に対する点cの位置を返す。(右、上：ture)

	line a_b;

	bool result = get_line( a , b , &a_b );
	if( result == false ){
		if( c.x > a.x ) return true;
		else return false;
	}
	else{
		if( c.y > a_b.a * c.x + a_b.b ) return true;
		else return false;
	}
}

bool get_cross( const point& a , const point& b , const point& c , const point& d )
{
	// 点a, cを結ぶ線分と、点b, dを通る直線とが交わればtrueを返す。

	bool result_ac_b = get_position( a , c , b );
	bool result_ac_d = get_position( a , c , d );
	if( result_ac_b == result_ac_d ) return false;
	else return true;
}

bool get_convex( const point& a , const point& b , const point& c , const point& d )
{
	// 点a, b, c, dの順に結んだ時にできる四角形が凸であればtrueを返す。

	bool result_ac_bd = get_cross( a , b , c , d ); // 線分acと直線bdの交差判定
	bool result_bd_ac = get_cross( b , a , d , c ); // 線分bdと直線acの交差判定

	if( result_ac_bd == true && result_bd_ac == true ) return true;
	else return false;
}

bool get_convex_new( const point& a , const point& b , const point& c , const point& d )
{
	bool result_ac_bd;
	bool result_bd_ac;

	if( get_position( a , c , b ) != get_position( a , c , d ) ) result_ac_bd = true;
	else result_ac_bd = false;

	if( get_position( b , d , a ) != get_position( b , d , c ) ) result_bd_ac = true;
	else result_bd_ac = false;

	if( result_ac_bd == true && result_bd_ac == true ) return true;
	else return false;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
typedef complex<double> Point;
typedef vector<Point> VP;
#define X real()
#define Y imag()

#define debug(x) cout<<#x<<": "<<x<<endl

double cross(Point a, Point b) {
  return a.X*b.Y - a.Y*b.X;
}

bool isConvex(VP ps) {
  int n = ps.size();
  vector<bool> ccw(n);
  rep(i,n) ccw[i] = cross(ps[(i+1)%n]-ps[i], ps[(i+2)%n]-ps[i])>0;
  rep(i,n-1) if(ccw[i]!=ccw[i+1]) return false;
  return true;
}

int main(void){
    double xa,ya,xb,yb,xc,yc,xd,yd;
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
        &xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF){
        if(isConvex({{xa,ya},{xb,yb},{xc,yc},{xd,yd}})){
            cout<<"YES"<<endl;
        }else cout<<"NO"<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define EPS 1e-10
typedef complex<double> P;

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

bool is_intersect(P a1, P a2, P b1, P b2) {
  return (cross(a2 - a1, b1 - a1) * cross(a2 - a1, b2 - a1) < EPS) &&
    (cross(b2 - b1, a1 - b1) * cross(b2 - b1, a2 - b1) < EPS);
}

int main() {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  char d;
  while (cin >> xa >> d >> ya >> d >> xb >> d >> yb >> d >> xc >> d >> yc >> d >> xd >> d >> yd) {
    P a(xa, ya), b(xb, yb), c(xc, yc), d(xd, yd);
    if (is_intersect(a, c, b, d)) cout << "YES\n";
    else cout << "NO\n";
  }
}