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 <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


inline double det(const P &a, const P &b) {
	return (conj(a) * b).imag();
}

int main() {
	double x[4], y[4];
	char c;
	for (; cin >> x[0] >> c >> y[0] ; ) {
		rep (i, 3) cin >> c >> x[i + 1] >> c >> y[i + 1];
		double s = 0.0;
		rep(i, 4) x[i] += 200, y[i] += 200;
		rep (i, 4) s += det(P(x[i], y[i]), P(x[(i + 1) % 4], y[(i + 1) % 4])) / 2.0;
		s = fabs(s);
		double sub_s = 0;
		rep(j, 4) {
			double ss = 0.0;
			rep(i, 4) if (i != j) {
				int idx = (i + 1) % 4;
				if (idx == j) idx = (i + 2) % 4;
				ss += det(P(x[i], y[i]), P(x[idx], y[idx])) / 2.0;
			}
			ss = fabs(ss);
			sub_s = max(sub_s, ss);
		}
		cout << (s >= sub_s ? "YES" : "NO") << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <vector>

using namespace std;

float calc_crossProduct(float x1, float y1, float x2, float y2){
  return (x1*y2-y1*x2);
}

int main(){
  int cnt = 0;
  while(true){
    string strall;
    cin >> strall;
    
    vector<float> x(4, 0.0);
    vector<float> y(4, 0.0);
    char c;
    for(int i=0;i<4;i++){
      int pos = strall.find(",");
      //      cout << pos << endl;
      //      cout << strall.substr(0, pos) << endl;
      x[i] = std::stof(strall.substr(0, pos));
      
      strall.erase(strall.begin(), strall.begin() +  pos + 1);
      //      cout << strall << endl;
      
      //      cout << strall.substr(0, pos) << endl; 
      y[i] = std::stof(strall.substr(0, pos));
      strall.erase(strall.begin(), strall.begin() + pos + 1);
    }

    if(cnt < 2){
      for(int i=0;i<4;i++){
	//	cout << "(" << x[i] << ", " << y[i] << ")" << endl;
      }
      cnt++;
    }


    bool flag = true;
    vector<float> cp(4, 0.0);    
    for(int i=0;i<4;i++){
     
      float x1 = x[i];float y1 = y[i];
      float x2 = x[(i+1)%4];float y2 = y[(i+1)%4];
      float x3 = x[(i+2)%4];float y3 = y[(i+2)%4];

      float x2x1 = x2-x1; float y2y1 = y2-y1;
      float x3x1 = x3-x1; float y3y1 = y3-y1;

      cp[i] = calc_crossProduct(x2x1, y2y1, x3x1, y3y1);
      if(cp[i] < 0){
	flag = false;
	break;
      }
    }

    if(flag != false){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }  
}

C++: #include<iostream>
#include<cstdio>
#include<complex>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
typedef complex<double> point;

double cross(point a,point b){
	return imag(conj(a)*b);
}

int main(){
	point in[4],p[4];
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&in[0].real(),&in[0].imag(),&in[1].real(),&in[1].imag(),&in[2].real(),&in[2].imag(),&in[3].real(),&in[3].imag())!=EOF){
		rep(i,4)p[i]=in[(i+1)%4]-in[i];
		bool check[4];
		rep(i,4)check[i]=(cross(p[i],p[(i+1)%4])>0)?true:false;
		if((check[0]&check[1]&check[2]&check[3])||(!check[0]&!check[1]&!check[2]&!check[3]))cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <complex>
using namespace std;
typedef complex<double> P;
double cross(P a, P b) {return (a.real() * b.imag() - a.imag() * b.real());}
int main(){
  char z;
  double p,q,r,s,t,u,v,w;
  P a,b,c,d;
  while(cin>>p>>z>>q>>z>>r>>z>>s>>z>>t>>z>>u>>z>>v>>z>>w){
  a = P(p,q);b = P(r,s);c = P(t,u);d = P(v,w);
  if ((cross(b-a,c-a)*cross(d-a,c-a))<0&&(cross(a-b,d-b)*cross(c-b,d-b))<0)cout<<"YES"<<endl;
  else cout << "NO" << endl;}
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define X real()
#define Y imag()
#define EQ(a,b) (abs((a)-(b))<EPS)
typedef complex<double> Po;
double isIntersect(Po p1,Po p2,Po p3,Po p4)
{
	//straight line(p1,p2) and line segment(p3,p4) are
	//if(n<0) crossed if(n==0) parallel if(n>0) not crossed
	return ((p1.X-p2.X)*(p3.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p3.X)) * ((p1.X-p2.X)*(p4.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p4.X));
}
int main()
{
	double x[4];
	double y[4];
	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]))
	{
	Po p[4];
	for(int i=0;i<4;i++)
	{
		p[i].X=x[i];
		p[i].Y=y[i];
	}
	if(isIntersect(p[0],p[2],p[1],p[3])>0.0||isIntersect(p[1],p[3],p[0],p[2])>0.0)
	{
		cout << "NO" << endl;
	}
	else
	{
		cout << "OK" << endl;
	}
	}
	return 0;
}