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 <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <complex>
#include <cstdio>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)

typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = (1e-10);    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) {
  return (conj(a)*b).Y;
}

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

int main() {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF) {
    P p[4] = {P(xa, ya), P(xb, yb), P(xc, yc), P(xd, yd)};

    bool ok = true;
    for (int i = 0; i < 4; i++) {
      if (ccw(p[i], p[(i+1)%4], p[(i+2)%4]) != ccw(p[(i+1)%4], p[(i+2)%4], p[(i+3)%4])) {
        ok = false;
        break;
      }
    }

    if (ok) {
      std::cout << "YES" << std::endl;
    }else {
      std::cout << "NO" << std::endl;
    }
  }
  
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
const int INF = 1<<28;
struct Vec{
  double x;
  double y;
};
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;
}

double cross(Vec &a,Vec &b){
  return a.x*b.y - a.y*b.x;
}
bool cal(int p,vector<double> &val){
  int np = p;
  int cnt = 0;
  vector<double> ans(3);
  while(cnt < 3){
    np++;
    np %=4;
    int nnp = (np+1)%4;
    if(cnt==2)nnp = (nnp+1)%4;
    Vec a;
    a.x = val[nnp*2] - val[np*2];
    a.y = val[nnp*2+1] - val[np*2+1];
    Vec b;
    b.x = val[p*2] - val[np*2];
    b.y = val[p*2+1] - val[np*2+1];
    ans[cnt] = cross(a,b);
    cnt++;
  }

  if(ans[0] < 0 && ans[1] < 0 && ans[2] < 0)return true;
  else if(ans[0] > 0 && ans[1] > 0 && ans[2] > 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++){
      if(cal(i,val))flag = 1;
    }
    if(flag)cout << "NO" << endl;
    else cout << "YES" << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

#define SIZE 300005
#define MOD 1000000007LL
#define INF INT_MAX / 3
#define LLINF 1LL << 60
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define FORALL(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FOREACH(i,c) for(auto (i) : (c))
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef long long ll;
typedef valarray<int> Array;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cout<<a[i];if(i==a.size()-1)cout<<endl;else cout<<" ";}}
int gcd(int a,int b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
int lcm(int a,int b){return a==0||b==0?0:a*b/gcd(a,b);}

double det(double x1, double y1, double x2, double y2, double x3, double y3)
{
  double a = x2 - x1;
  double b = y2 - y1;
  double c = x3 - x1;
  double d = y3 - y1;
  return a*d-b*c;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  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))
  {
    double a1 = det(x1,y1,x2,y2,x3,y3);
    double a2 = det(x1,y1,x2,y2,x4,y4);
    double a3 = det(x2,y2,x4,y4,x1,y1);
    double a4 = det(x2,y2,x4,y4,x3,y3);
    printf("%s\n",(a1*a2>0&&a3*a4>0)?"NO":"YES");
  }
  return 0;
}

C++: &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h>

using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;

namespace std {
    bool operator < (const P& a, const P& b) {
        return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
    }
}
double cross(const P& a, const P& b) {
    return imag(conj(a)*b);
}
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;       // counter clockwise
    if (cross(b, c) < 0)   return -1;       // clockwise
    if (dot(b, c) < 0)     return +2;       // c--a--b on line
    if (norm(b) < norm(c)) return -2;       // a--b--c on line
    return 0;
}

vector<P> convex_hull(vector<P> ps) {
    int n = ps.size(), k = 0;
    sort(ps.begin(), ps.end());
    vector<P> ch(2*n);
    for (int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull
        while (k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
    for (int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--]) // upper-hull
        while (k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
    ch.resize(k-1);
    return ch;
}

int main(){
    vector<P> v(4);
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &v[0].real(), &v[0].imag(), &v[1].real(), &v[1].imag(), &v[2].real(), &v[2].imag(), &v[3].real(), &v[3].imag()) != EOF){
        vector<P> q =  convex_hull(v);
        cout << (q.size()==4?"YES":"NO") << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>

#define X first
#define Y second
#define dis(a, b) (b.X - a) * (b.X - a) + (b.Y - a) * (b.Y - a)

using namespace std;

double cross(pair<double, double> lineA, pair<double, double> lineB){
	return (lineB.X * lineA.Y - lineA.X * lineB.Y) / sqrt(dis(0, lineB));
}

int main(){
	pair<double, double> pointA, pointB, pointC, pointD;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &pointA.X, &pointA.Y, &pointB.X, &pointB.Y, &pointC.X, &pointC.Y, &pointD.X, &pointD.Y) != EOF){
		vector<pair<double, double> > point;
		point.push_back(pointA);
		point.push_back(pointB);
		point.push_back(pointC);
		point.push_back(pointD);
		bool hekomi = false;
		for(int i = 0; i < point.size(); i++){
			pair<double, double> lineA(point[(i + 1) % 4].X - point[i].X, point[(i + 1) % 4].Y - point[i].Y); 
			pair<double, double> lineB(point[(i + 2) % 4].X - point[i].X, point[(i + 2) % 4].Y - point[i].Y);
			if(cross(lineA, lineB) > 0){
				hekomi = true;
				break;
			}
		}

		cout << (hekomi ? "NO" : "YES") << endl;
	}
	return 0;
}