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 check(double ax,double ay, double bx, double by){
  return ax*by - ay*bx;
}

int main(){
  double x[4],y[4];
  char c;

  while( cin>>x[0]>>c>>y[0] && c ){
    for( int i=1;i<4;i++ )
      cin >> c >>  x[i] >> c >> y[i];

    bool f=true;
    for( int i=0;i<4;i++ ){
      int j = (i+1)%4, k=(i+2)%4, l=(i+3)%4;

      double ax=x[i]-x[j], ay=y[i]-y[j];
      if( check(ax,ay,x[j]-x[k],y[j]-y[k]) *
	  check(ax,ay,x[j]-x[l],y[j]-y[l]) > 0 ){
      }else{
	f=false;
	break;
      }
    }
    if( f )
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

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

typedef 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);
}

bool eq(ld a, ld b){
  return abs(a-b) < EPS;
}

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) < 0) 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<cstdio>
#define _USE_MATH_DEFINES
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;


#define INF 1e+10
#define EPS 1e-10
#define EQ(a,b) (abs(a-b)<EPS)

//誤差を考慮して足し算
double add(double a,double b){
	if(abs(a+b) < EPS*(abs(a)+abs(b)))return 0;
	return a+b;
}
struct P{//2次元ベクトル
	double x,y;
	P(){}
	P(double x,double y):x(x),y(y){}
	P operator + (P p)const{
		return P(add(x,p.x),add(y,p.y));
	}
	P operator - (P p)const{
		return P(add(x,-p.x),add(y,-p.y));
	}
	P operator * (double d)const{
		return P(x*d,y*d);
	}
	P operator / (double d)const{
		return P(x/d,y/d);
	}
	double dot(P p)const{//内積
		return add(x*p.x,y*p.y);
	}
	double det(P p)const{//外積
		return add(x*p.y,-y*p.x);
	}
	bool equal(P p)const{
		return (x-p.x)*(x-p.x)+(y-p.y)*(y-p.y) < EPS*EPS;
	}
	double norm()const{
		return sqrt(x*x+y*y);
	}
};


int ccw(P a, P b, P c){
	b = b-a;
	c = c-a;
	if (b.det(c) > 0)   return +1;       // counter clockwise
	if (b.det(c) < 0)   return -1;       // clockwise
	if (b.dot(c) < 0)     return +2;       // c--a--b on line
	if (b.norm() < c.norm()) return -2;       // a--b--c on line
	return 0;
}

int main(){
	P a,b,c,d;
	char _;
	while(cin>>a.x>>_>>a.y>>_>>b.x>>_>>b.y>>_>>c.x>>_>>c.y>>_>>d.x>>_>>d.y){
		int f=0,r;
		r=ccw(a,b,c);
		if(r==-1)f|=1;
		else if(r==1)f|=2;
		r=ccw(b,c,d);
		if(r==-1)f|=1;
		else if(r==1)f|=2;
		r=ccw(c,d,a);
		if(r==-1)f|=1;
		else if(r==1)f|=2;
		r=ccw(d,a,b);
		if(r==-1)f|=1;
		else if(r==1)f|=2;
		if(f!=3)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

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

typedef double dbl;
dbl x[4], y[4];
bool point(dbl x[], dbl y[], int n) {
	dbl nx[3], ny[3];
	for (int i = 0, j = 0; i < 4; i++) {
		if (i != n) {
			nx[j] = x[i];
			ny[j++] = y[i];
		}
	}
	dbl S, s[3];
	S = fabs((nx[1] - nx[0])*(ny[2] - ny[0]) - (ny[1] - ny[0])*(nx[2] - nx[0])) / 2.0;
	for (int i = 0; i < 3; i++) {
		nx[i] -= x[n]; 
		ny[i] -= y[n];
	}
	for (int i = 0; i < 3; i++) {
		s[i] = fabs(nx[i] * ny[(i + 1) % 3] - ny[i] * nx[(i + 1) % 3]) / 2.0;
	}
	if (fabs(S - s[0] - s[1] - s[2]) < 1e-10) return true;
	else return false;
}
int main() {
	char c;
	while (cin >> x[0] >> c >> y[0]) {
		int ok = 1;
		for (int i = 1; i < 4; i++) {
			cin >> c >> x[i] >> c >> y[i];
		}
		for (int i = 0; i < 4; i++) {
			if (point(x, y, i)) {
				cout << "NO\n";
				ok = 0;
				break;
			}
		}
		if(ok) cout << "YES\n";
	}
}

C++: #include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

double dot(P a,P b){return real(conj(a)*b);}
double cross(P a,P b){return imag(conj(a)*b);}

int main(){
  double a,b,c,d,e,f,g,h;
  while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h)){
    P x[6];
    x[0] = P(a,b);
    x[1] = P(c,d);
    x[2] = P(e,f);
    x[3] = P(g,h);
    x[4] = x[0];
    x[5] = x[1];
    double ccw = cross(x[2]-x[0],x[1]-x[0]);
    bool flag = true;
    REPR(i,4){
      double ccc = cross(x[2+i]-x[i],x[1+i]-x[i]);
      if(ccw*ccc <= 0){
        flag = false;
        break;
      }
    }
    if(flag){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

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;
  }
}