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 <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main() {
	double point[8];
	
	char c;
	bool yes;
	while (cin >> point[0] >> c >> point[1] >> c >> point[2] >> c >> point[3] >> c >> point[4] >> c >> point[5] >> c >> point[6] >> c >> point[7]){
		vector<bool> posi;
		yes=true;
		REP(i, 4){
			double angle = atan2(point[((i + 1) % 4) * 2 + 1] - point[(i % 4) * 2 + 1], point[((i + 1) % 4) * 2] - point[(i % 4) * 2]);
			if (angle>0.0){
				posi.push_back(true);
			} else if(angle<0.0) {
				posi.push_back(false);
			}
			
		}
		if (posi[0] == posi[1] && posi[2] == posi[1] && posi[2] == posi[3])
			cout << "YES"<<endl;
			else
				cout << "NO" << endl;
	}
	return 0;
}

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

typedef complex<double> P;
typedef vector<P> G;
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
#define prev(P, i) P[(i+P.size()-1)%P.size()]

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

int ccw(P a, P b, P c){
  b-=a; c-=a;
  if(cross(b, c) > 0) return +1;
  if(cross(b, c) < 0) return -1;
  if(dot(b, c) < 0) return +2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}
bool isconvex(const G &p){
  for(int i=0; i<p.size(); ++i)
    if(ccw(prev(p, i), curr(p, i), next(p, i)) > 0)return false;
  return true;
}

int main(){
  char t;
  P a, b, c, d;
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a.real(), &a.imag(), &b.real(), &b.imag(), &c.real(), &c.imag(), &d.real(), &d.imag())!=EOF){
    bool flag=false;
    G g;
    g.clear();
    g.push_back(a); g.push_back(b); g.push_back(c); g.push_back(d);
    if(isconvex(g)){flag=true;}
    g.clear();
    g.push_back(d); g.push_back(c); g.push_back(b); g.push_back(a);
    if(isconvex(g)){flag=true;}

    if(flag) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

class Point{
public:
    double y, x;
    Point(double y0, double x0){
        y = y0;
        x = x0;
    }
    Point(){
        y = x = 0.0;
    }
    double cross(const Point& p) const{
        return x * p.y - y * p.x;
    }
    Point operator-(const Point& p) const{
        return Point(y - p.y, x - p.x);
    }
};

int main()
{
    for(;;){
        vector<Point> p(4);
        for(int i=0; i<4; ++i){
            char c;
            if(!(cin >> p[i].x >> c >> p[i].y))
                return 0;
            if(i < 3)
                cin >> c;
        }

        bool plus = true;
        bool minus = true;
        for(int i=0; i<4; ++i){
            Point p1 = p[(i+1)%3] - p[i];
            Point p2 = p[(i+2)%3] - p[i];
            if(p1.cross(p2) < 0)
                plus = false;
            else
                minus = false;
        }
        if(plus || minus)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
}

C++: #include <iostream>

using namespace std;

struct Vector {
        double x;
        double y;
};

bool is_c_inner(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) {
    Vector ab = Vector{xb - xa, yb - ya};
    Vector bc = Vector{xc - xb, yc - yb};

    Vector bd = Vector{xd - xb, yd - yb};
    Vector dc = Vector{xc - xd, yc - yd};

    Vector da = Vector{xa - xd, ya - yd};
    Vector ac = Vector{xc - xa, yc - ya};

    double cross_product_1 = ab.x * bc.y - ab.y * bc.x;
    double cross_product_2 = bd.x * dc.y - bd.y * dc.x;
    double cross_product_3 = da.x * ac.y - da.y * ac.x;

    return (cross_product_1 >=  0 && cross_product_2 >=  0 && cross_product_3 >=  0) ||
            (cross_product_1 <=  0 || cross_product_2 <=  0 && cross_product_3 <=  0);
}

int main() {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    string result;

    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF) {
        if(is_c_inner( xa, ya, xb, yb, xc, yc, xd, yd)
                || is_c_inner(xb, yb, xc, yc, xd, yd, xa, ya)
                || is_c_inner(xc, yc, xd, yd, xa, ya, xb, yb)
                || is_c_inner(xd, yd, xa, ya, xb, yb, xc, yc)
                ) {
            result = "NO"; // no convex
        } else {
            result = "YES"; //convex
        }
        cout << result << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
vector<string> split(const string &str, char delim){
  vector<string> res;
  size_t current = 0, found;
  while((found = str.find_first_of(delim, current)) != string::npos){
    res.push_back(string(str, current, found - current));
    current = found + 1;
  }
  res.push_back(string(str, current, str.size() - current));
  return res;
}
bool cal(int i,int j,int l,int k,vector<double> &val){
  double kata = (val[i*2]-val[j*2])/(val[i*2+1]-val[j*2+1]);
  double sen1 = kata*(val[2*l] - val[i*2])+val[i*2+1];
  double sen2 = kata*(val[2*k] - val[i*2])+val[i*2+1];
  if((sen1 - val[2*l+1])*(sen2 - val[2*k+1]) > 0 )return true;
  return false;
}
int main(){
  string str;
  while(cin >> str){
    vector<string> s_v = split(str,',');
    vector<double> val(8);
    for(int i = 0;i < 8;i++){
      val[i] = stod(s_v[i]);
    }
    int flag = 0;
    for(int i = 0;i < 4;i++){
      for(int j = 0;j < 4;j++){
	if(i == j)break;
	for(int k = 0;k < 4;k++){
	  if(i == k || j == k)break;
	  for(int l = 0;l < 4;l++){
	    if(i == l || j == l || k == l)break;
	    if(cal(i,j,k,l,val)){
	      flag = 1;
	    }
	  }
	}
      }
    }
    if(flag)cout << "NO" << endl;
    else cout << "YES" << endl;
  }
  return 0;
}