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<cstdio>
#include<vector>
#include<complex>
#include<algorithm>
#define P complex<double>
using namespace std;

bool cmp_p(const P& a, const P& b)
{
  return a.real() == b.real() ? a.imag() < b.imag() : a.real() < b.real();
}

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

vector<P> graham_scan(P* ps, int n)
{
  sort(ps, ps + n, cmp_p);
  int k = 0;
  vector<P> qs(n * 2);
  for(int i = 0; i < n; i++)
  {  
    while(k > 1 && det(qs[k - 1] - qs[k - 2], ps[i] - qs[k - 1]) <= 0)
      k--;
    qs[k++] = ps[i];
  }
  for(int i = n - 2, t = k; i >= 0; i--)
  {  
    while(k > t && det(qs[k - 1] - qs[k - 2], ps[i] - qs[k - 1]) <= 0)
      k--;
    qs[k++] = ps[i];
  }
  qs.resize(k - 1);
  return qs;
}

P p[4];
double xa, ya, xb, yb, xc, yc, xd, yd;
int main()
{
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != -1)
  {
    p[0] = P(xa, ya);
    p[1] = P(xb, yb);
    p[2] = P(xc, yc);
    p[3] = P(xd, yd);
    cout << (graham_scan(p, 4).size() == 4 ? "YES" : "NO") << endl;
  }
}

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()]) > 0)
			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 <bits/stdc++.h>
using namespace std;

typedef long double ld;

const ld EPS = 1e-9;
const ld INF = 1e10;
const ld PI = M_PI;

struct Point{
  ld x, y;
  Point(ld x, ld y):x(x), y(y){}
  Point(){}
};

Point operator+(const Point &a, const Point &b){
  return Point(a.x + b.x, a.y + b.y);
}
Point operator-(const Point &a, const Point &b){
  return Point(a.x - b.x, a.y - b.y);
}
Point operator*(const Point &a, const ld b){
  return Point(a.x * b, a.y * b);
}
Point operator*(const Point &a, const Point &b){
  return Point(a.x*b.x-a.y*b.y, a.x*b.y+a.y*b.x);
}
Point operator/(const Point &a, const ld b){
  return Point(a.x / b, a.y / b);
}

typedef vector<Point> Polygon;

Point next(const Polygon &a, int x){
  return a[(x+1)%a.size()];
}
Point prev(const Polygon &a, int x){
  return a[(x-1+a.size()) % a.size()];
}

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

ld dot(const Point &a, const Point &b){
  return a.x*b.x + a.y*b.y;
}
ld norm(const Point &a){
  return dot(a, a);
}

int ccw(Point a, Point b, Point c){
  b = b - a;
  c = c - a;
  if(cross(b, c) > EPS) return +1; // 反時計周り
  if(cross(b, c) < -EPS) return -1; // 時計周り
  if(dot(b, c) < -EPS) return +2; // c -- a -- b がこの順番に一直線上
  if(norm(b) < norm(c)) return -2; // a -- b -- c がこの順番に一直線上
  return 0; // a -- c -- b が一直線上
}

bool is_convex(const Polygon &poly){
  for(int i = 0 ; i < (int)poly.size() ; i++){
    if(ccw(prev(poly, i), poly[i], next(poly, i)) == -1) return false;
  }
  return true;
}

int main(){
  ld 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){
    Polygon poly;
    poly.push_back(Point(xa, ya));
    poly.push_back(Point(xb, yb));
    poly.push_back(Point(xc, yc));
    poly.push_back(Point(xd, yd));
    cout << (is_convex(poly) ? "YES" : "NO") << endl;
  }
  
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

#define AB2 ((x[1] - x[0])*(x[1] - x[0]) + (y[1] - y[0])*(y[1] - y[0]))
#define BC2 (x[2] - x[1])*(x[2] - x[1]) + (y[2] - y[1])*(y[2] - y[1])
#define CD2 (x[3] - x[2])*(x[3] - x[2]) + (y[3] - y[2])*(y[3] - y[2])
#define DA2 (x[0] - x[3])*(x[0] - x[3]) + (y[0] - y[3])*(y[0] - y[3])
#define CA2 (x[0] - x[2])*(x[0] - x[2]) + (y[0] - y[2])*(y[0] - y[2])
#define BD2 (x[3] - x[1])*(x[3] - x[1]) + (y[3] - y[1])*(y[3] - y[1])

int main(){
  double x[4], y[4];
  bool rad = true;
  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])){
    if((x[1] - x[0]) * (x[3] - x[0]) + (y[1] - y[0]) * (y[3] - y[0]) < 0){
      rad = false;
    }
    if((x[0] - x[3]) * (x[2] - x[3]) + (y[0] - y[3]) * (y[2] - y[3]) < 0){

      rad = false;
    }
    if((x[3] - x[2]) * (x[1] - x[2]) + (y[3] - y[2]) * (y[1] - y[2]) < 0){

      rad = false;
    }
    if((x[0] - x[1]) * (x[2] - x[1]) + (y[0] - y[1]) * (y[2] - y[1]) < 0){

      rad = false;
    }
    if(rad == true){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
}

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

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)
const double EPS=1e-6;

int main(){

	while(true){

		double xa,ya,xb,yb,xc,yc,xd,yd;
		cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd;
		if(cin.fail()) break;

		double a1=ya-yc;
		double b1=xc-xa;
		double c1=ya*(xa-xc)-xa*(ya-yc);
		double a2=yb-yd;
		double b2=xd-xb;
		double c2=yb*(xb-xd)-xb*(yb-yd);

		if((a1*xb+b1*yb+c1)*(a1*xd+b1*yd+c1)<+EPS && (a2*xa+b2*ya+c2)*(a2*xc+b2*yc+c2)<+EPS) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}