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++: #pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};


typedef complex<double> Point, Vector;
typedef pair<Point, Point> Segment, Line;
typedef vector<Point> Polygon;

#define X real()
#define Y imag()
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

double dot(Vector a, Vector b){
    return a.X * b.X + a.Y * b.Y;
}

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

double norm(Vector a){
    return a.X * a.X + a.Y * a.Y;
}

double abs(Vector a){
    return sqrt(norm(a));
}

// ベクトルと点の位置関係
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw(Point p0, Point p1, Point p2){
    Vector a = p1 - p0;
    Vector b = p2 - p0;
    if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
    if(cross(a, b) < -EPS) return CLOCKWISE;
    if(dot(a, b) < -EPS) return ONLINE_BACK;
    if(norm(a) < norm(b)) return ONLINE_FRONT;

    return ON_SEGMENT;
}

bool isConvex(Polygon pol){
    int n = pol.size();

    for(int i=0; i<n; i++){
        if(ccw(pol[i], pol[(i+1)%n], pol[(i+2)%n]) == CLOCKWISE){
            return false;
        }
    }

    return true;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    double x1, y1, x2, y2, x3, y3, x4, y4;
    char a;
    while(cin>>x1>>a>>y1>>a>>x2>>a>>y2>>a>>x3>>a>>y3>>a>>x4>>a>>y4){
        Point p1 = Point(x1, y1), p2 = Point(x2, y2), p3 = Point(x3, y3), p4 = Point(x4, y4);
        Polygon pol1, pol2;
        pol1.emplace_back(p1);
        pol1.emplace_back(p2);
        pol1.emplace_back(p3);
        pol1.emplace_back(p4);

        pol2.emplace_back(p1);
        pol2.emplace_back(p4);
        pol2.emplace_back(p3);
        pol2.emplace_back(p2);

        cout << (isConvex(pol1) || isConvex(pol2) ? "YES" : "NO") << endl;
    }


    return 0;
}

C++: #include <stdio.h>

int main(void) {

  double xa,ya,xb,yb,xc,yc,xd,yd;

  double angle1,angle2;
  double temp;
  double x,y;

  //üªACÆ¼üBDA é¢Í¼üACÆüªBDªð··êÎÊp`
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF) {

    if(xa==xc) {

      temp=(yd-yb)*(xa-xb)/(xd-xb)+yb;

      if((temp>ya && temp>yc) || (temp<ya && temp<yc)) printf("NO\n");

      else printf("YES\n");

    }

    else if(xb==xd) {

      temp=(yc-ya)*(xb-xa)/(xc-xa)+ya;

      if((temp>yb && temp>yd) || (temp<yb && temp<yd)) printf("NO\n");

      else printf("YES\n");

    }

    else {

      angle1=(yc-ya)/(xc-xa);
      angle2=(yd-yb)/(xd-xb);

      x=((angle1*xa-angle2*xb)-ya+yb)/(angle1-angle2);
      y=angle1*(x-xa)+ya;

      if((x>xa && x>xc) || (x<xa && x<xc) || (x>xb && x>xd) || (x<xb && x<xd)) printf("NO\n");

      else printf("YES\n");

    }

  }

  return 0;

}

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <cmath>
#include <sstream>
#define F first
#define S second
#define FOR(i,n) for(int i=0;i<(int)n;i++)
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define FORI(i,k,n) for(int i=k;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
typedef pair<double, double> pdd;
const double EPS = 10e-6;
double wid(pdd a, pdd b) {
	return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
}
double yoge(pdd a, pdd b, pdd c) {
	double A, B, C;
	C = wid(a, b); A = wid(b, c); B = wid(c, a);
	return abs(acos((B*B+C*C-A*A)/(2*B*C)));
}
int main() {
	pdd 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)!=EOF) {
		double x=yoge(p[0],p[3],p[1])/3.1415926535*180+
			yoge(p[1],p[0],p[2])/3.1415926535*180+
			yoge(p[2],p[1],p[3])/3.1415926535*180+
			yoge(p[3],p[2],p[0])/3.1415926535*180-360;
		if(x<EPS&&x>-1*EPS)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}

}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define X real()
#define Y imag()
#define EQ(a,b) (abs((a)-(b))<EPS)
typedef complex<double> Po;
double isIntersect(Po p1,Po p2,Po p3,Po p4)
{
	//straight line(p1,p2) and line segment(p3,p4) are
	//if(n<0) crossed if(n==0) parallel if(n>0) not crossed
	return ((p1.X-p2.X)*(p3.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p3.X)) * ((p1.X-p2.X)*(p4.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p4.X));
}
int main()
{
	double x[4];
	double y[4];
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3])!=EOF)
	{
	Po p[4];
	for(int i=0;i<4;i++)
	{
		p[i].X=x[i];
		p[i].Y=y[i];
	}
	if(isIntersect(p[0],p[2],p[1],p[3])>0.0||isIntersect(p[1],p[3],p[0],p[2])>0.0)
	{
		cout << "NO" << endl;
	}
	else
	{
		cout << "YES" << endl;
	}
	}
	return 0;
}

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

const double eps = 1e-12;
double x[4], y[4];

void rotate()
{
    double lx = x[3], ly = y[3];
    for ( int i = 2; i >= 0; i-- ) x[i+1] = x[i], y[i+1] = y[i];
    x[0] = lx, y[0] = ly;
}

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

bool check()
{
    double a = cross( x[1] - x[0], y[1] - y[0], x[3] - x[0], y[3] - y[0] );
    double b = cross( x[2] - x[1], y[2] - y[1], x[3] - x[1], y[3] - y[1] );
    double c = cross( x[0] - x[2], y[0] - y[2], x[3] - x[2], y[3] - y[2] );
    return ( a > 0 && b > 0 && c > 0 ) || ( a < 0 && b < 0 && c < 0 );
}

bool solve()
{
    for ( int i = 0; i < 4; i++ )
    {
        if ( check() ) return false;
        rotate();
    }
    return true;
}

int main( void )
{
    string input;
    while ( cin >> input )
    {
        replace( input.begin(), input.end(), ',', ' ' );
        istringstream is(input);

        for ( int i = 0; i < 4; i++ ) is >> x[i] >> y[i];

        cout << ( solve()? "YES" : "NO" ) << endl;
    }

    return 0;
}