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++: import Data.List.Split
import Control.Applicative

data YesNo = YES | NO deriving(Show)
type Coord = (Double, Double)

reshape :: [Double] -> [Coord]
reshape [] = []
reshape [_] = []
reshape (x:y:xs) = (x, y) : reshape xs

normalForm :: [Coord] -> [Coord]
normalForm xs =
  let minY = minimum (map snd xs)
      mins = filter (\c -> snd c == minY) xs
      st   = head mins
  in
      st : (tail (dropWhile (/= st) xs) ++ takeWhile (/= st) xs)

delta :: Coord -> Coord -> Coord -> Double
delta x y z =
  ((fst y - fst x) * (snd z - snd x) - (fst z - fst x) * (snd y - snd x)) / 2

solver' :: [Double] -> YesNo
solver' xs =
  let (p1:p2:p3:p4:_) = normalForm $ reshape xs
  in
      if (delta p1 p2 p3 * delta p2 p3 p4 * delta p3 p4 p1 > 0)
        && ((snd p2 > snd p1) || (snd p2 >= snd p3))
        && ((snd p3 > snd p2) || (snd p3 >= snd p4))
        && ((snd p4 > snd p3) || (snd p4 >= snd p1))
        then YES
        else NO

solver :: [[Double]] -> [YesNo]
solver = map solver'

main :: IO()
main = do
  contents <- lines <$> getContents
  let xs = map (map (read :: String -> Double) . splitOn ",") contents
  mapM_ print $ solver xs

C++: 	#include<stdio.h>
int main()
{
    double ax,ay,bx,by,cx,cy,dx,dy;
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy)){
        if(((ax-cx)*(by-ay)+(ay-cy)*(ax-bx))*((ax-cx)*(dy-ay)+(ay-cy)*(ax-dx))<=0&& ((bx-dx)*(ay-by)+(by-dy)*(bx-ax))*((bx-dx)*(cy-by)+(by-dy)*(bx-cx))<=0)printf("YES\n");
        else printf("NO\n");
    }
}

C++: #include <cstdio>

using namespace std;

struct Point {
	double x, y;
	Point(double x = 0, double y = 0) : x(x), y(y){}
	Point operator - (Point p) {return (Point(x - p.x, y - p.y));}
};

double cross(Point a, Point b)
{
	return (a.x * b.y - a.y * b.x);
}

int ccw(Point x, Point y)
{
	if (cross(x, y) > 0) return (+1);
	return (0);
}

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) != EOF){
		int dir = ccw(b - a, c - a) + ccw(c - b, d - b) + ccw(d - c, a - c) + ccw(a - d, b - d);
		printf("%s\n", dir % 4 ? "NO" : "YES");
	}
	return (0);
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#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 - (Point p) { return Point(x-p.x, y-p.y); }
};
typedef Point Vector;
double cross(Vector a, Vector b) { return a.x*b.y - a.y*b.x; }

Point p[4];

bool solve() {
  double c0 = cross(p[1] - p[0], p[2] - p[0]);
  for(int i = 1; i < 4; i++) {
    if(c0 * cross(p[(i+1)%4] - p[i], p[(i+2)%4] - p[i]) < 0.0) return false;
  }
  return true;
}

main() {
  while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
	       &p[0].x, &p[0].y, &p[1].x, &p[1].y,
	       &p[2].x, &p[2].y, &p[3].x, &p[3].y) != EOF )
    { cout << (solve() ? "YES" : "NO") << endl; }
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }



struct Point2D { 
	double x, y;
	Point2D (double a=0, double b=0) { x=a; y=b; }
};

typedef Point2D Vector2D;

double dist2D(const Point2D& a, const Point2D& b) { return sqrt( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) ); }

Vector2D sub_vector2D(const Vector2D& a, const Vector2D& b) {
	Vector2D ret;
	ret.x = a.x - b.x; ret.y = a.y - b.y;
	return ret;
}

double cross_product(const Vector2D& a, const Vector2D& b) { return a.x*b.y - a.y*b.x; }

double inner_product(const Vector2D& a, const Vector2D& b) { return a.x*b.x + a.y*b.y; }

bool point_in_triangle_2D(const Point2D& a, const Point2D& b, const Point2D& c, const Point2D& p) {
	Vector2D ab = sub_vector2D(b, a); Vector2D bp = sub_vector2D(p, b);
	Vector2D bc = sub_vector2D(c, b); Vector2D cp = sub_vector2D(p, c);
	Vector2D ca = sub_vector2D(a, c); Vector2D ap = sub_vector2D(p, a);
	double c1 = cross_product(ab, bp), c2 = cross_product(bc, cp), c3 = cross_product(ca, ap);
	return ( (c1>0 && c2>0 && c3>0) || (c1<0 && c2<0 && c3<0) );
}

struct Circle {
	Point2D c; 
	double r;
	Circle (double a=0, double b=0, double rr=0) { c.x=a; c.y=b; r=rr; }
};

bool point_in_circle(const Point2D& p, const Circle& t) {
	double dist = dist2D(p, t.c);
	return (dist <= t.r);
}

int circle_intersect(const Circle& a, const Circle& b) {
	double dist = dist2D(a.c, b.c);
	if (a.r + b.r < dist) return 0;	// no
	if (dist + b.r < a.r) return 2;	// b in a
	if (dist + a.r < b.r) return -2;	// a in b
	return 1;	// collision
}

struct Polygon {
	vector<Point2D> pset;
	Polygon (int size=3) { pset.assign(size, Point2D(0,0)); }
};

bool point_in_polygon(const Polygon& pol, const Point2D& p) {
	int cnt = 0;
	int n = (int)pol.pset.size();
	
	for (int i = 1; i<=n; i++) {
		Point2D p0 = pol.pset[i-1], p1 = pol.pset[i%n];
		bool flag0x = (p.x <= p0.x), flag0y = (p.y <= p0.y);
		bool flag1x = (p.x <= p1.x), flag1y = (p.y <= p1.y);
		
		if (flag0y != flag1y) {
			if ( (flag0x == flag1x) && flag0x) {
				cnt += (flag0y ? -1 : 1);
			} else if (p.x <= ( p0.x+(p1.x-p0.x)*(p.y-p0.y)/(p1.y-p0.y) ) ) {
				cnt += (flag0y ? -1 : 1);
			}
		}
	}
	
	return (cnt!=0);
}

int MAX = 4;

int main() {
	Polygon p(MAX);
	char c;
	while (cin>>p.pset[0].x) {
		cin >> c >> p.pset[0].y;
		for_(i, 1, MAX) cin >> c >> p.pset[i].x >> c >> p.pset[i].y;
		
		Polygon q(0);
		Point2D r;
		bool flag = true;
		for_(i, 0, MAX) {
			r = p.pset[i];
			q.pset.clear();
			for_(j, 0, MAX) {
				if (i==j) continue;
				q.pset.pb(p.pset[j]);
				if (point_in_polygon(q, r)) flag = false;
			}
		}
		
		if (flag) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

int main()
{
	const double PI = acos(-1);
	double x[4], y[4];
	complex<double> z[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]) {

		for (int i = 0; i < 4; i++) {
			z[i].real(x[i]);
			z[i].imag(y[i]);
		}

		bool f = 1;

		for (int i = 0; i < 4; i++) {
			int j = (i + 1) % 4, k = (i + 2) % 4;
			double t = arg((z[k] - z[j]) / (z[j] - z[i]));
			if (!(t > 0 && t < PI)) {
				f = 0;
				break;
			}
		}

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

	return 0;
}