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<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8, pi = acos(-1.0);
bool eq(ld a, ld b){return (abs(b-a)<eps);}
ld dot(Point a, Point b){return real(conj(a)*b);}
ld cross(Point a, Point b){ return imag(conj(a)*b);}
int ccw(Point a, Point b, Point c){
  b-=a;c-=a;
  if(cross(b,c)>eps) return 1;//countor_crockwise
  if(cross(b,c)<-eps) return -1;//crockwise
  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
}

int main(){
  ld xa,ya,xb,yb,xc,yc,xd,yd;
  Point a,b,c,d;
  while(scanf("%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=-1){
    a=Point(xa,ya);
    b=Point(xb,yb);
    c=Point(xc,yc);
    d=Point(xd,yd);
    int abc = ccw(a,b,c);
    int bcd = ccw(b,c,d);
    int cda = ccw(c,d,a);
    int dab = ccw(d,a,b);
    if((abc==1&&bcd==1&&cda==1&&dab==1)||(abc==-1&&bcd==-1&&cda==-1&&dab==-1))
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }
}

C++: #include<iostream>

using namespace std;

typedef struct{
	double x,y;
}Point_obj;

class Vector_obj{
private:
	double x,y;
public:
	void set(Point_obj *p0,Point_obj *p1){
		x = p1->x - p0->x;
		y = p1->y - p0->y;
	}
	void print(){
		cout<<x<<" "<<y<<endl;
	}
	double GetX(){return x;}
	double GetY(){return y;}
};

double exteriorProduct(Vector_obj *v0,Vector_obj *v1){
	return v0->GetX() * v1->GetY() - v0->GetY() * v1->GetX();
}


int main(){

	Point_obj point[4];
	Vector_obj Vector[8];
	char tmp;

	while(cin>>point[0].x){
		cin>>tmp;
		cin>>point[0].y;
		cin>>tmp;

		for(int i=1;i<4;i++){
			cin>>point[i].x;
			cin>>tmp;
			cin>>point[i].y;
			if(i!=3){
				cin>>tmp;
			}
		}

		for(int i=0;i<8;i+=2){
			Vector[i].set(&point[i/2],&point[(i/2+1)%4]);
			//Vector[i].print();
			Vector[i+1].set(&point[i/2],&point[(i/2+2)%4]);
			//Vector[i+1].print();
		}

		double tmp;
		
		tmp = exteriorProduct(&Vector[0],&Vector[1]);

		if(tmp >= 0){
			if( exteriorProduct(&Vector[2],&Vector[3]) >= 0 && exteriorProduct(&Vector[4],&Vector[5]) >= 0
				&& exteriorProduct(&Vector[6],&Vector[7]) >= 0){
					cout<<"YES"<<endl;
			}
			else{
				cout<<"NO"<<endl;
			}
		}
		else{
			if( exteriorProduct(&Vector[2],&Vector[3]) < 0 && exteriorProduct(&Vector[4],&Vector[5]) < 0
				&& exteriorProduct(&Vector[6],&Vector[7]) < 0){
					cout<<"YES"<<endl;
			}
			else{
				cout<<"NO"<<endl;
			}

		}

	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

double distance(double x0, double y0, double x1, double y1)
{
	double x = x1 - x0;
	double y = y1 - y0;

	return sqrt(x * x + y * y);
}

double angle(double b, double c, double a)
{
	return acos((b * b + c * c - a * a) / (2 * b * c)) * (180 / M_PI);
}

int main()
{
	string s;
	for (; getline(cin, s);)
	{
		stringstream ss;
		ss << s;

		vector<double> x(4);
		vector<double> y(4);

		for (int i = 0; i < 4; i++)
		{
			ss >> x.at(i);
			ss.ignore();

			ss >> y.at(i);
			ss.ignore();
		}

		double a = distance(x.at(0), y.at(0), x.at(1), y.at(1));
		double b = distance(x.at(1), y.at(1), x.at(2), y.at(2));
		double c = distance(x.at(2), y.at(2), x.at(3), y.at(3));
		double d = distance(x.at(3), y.at(3), x.at(0), y.at(0));

		double e0 = distance(x.at(0), y.at(0), x.at(2), y.at(2));
		double e1 = distance(x.at(1), y.at(1), x.at(3), y.at(3));

		if ((e0 < a && e0 < b) || (e0 < c && e0 < d) || (e1 < a && e1 < d) || (e1 < b && e1 < c))
		{
			cout << "NO" << endl;
		}
		else
		{
			cout << "YES" << endl;
		}
	}
}

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

typedef complex<double> P;

#define x real()
#define y imag()

double isIntersect(P p1, P p2,P p3,P p4 ){
  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 xa,ya,xb,yb,xc,yc,xd,yd;
  char e;
  while( cin >> xa >> e >> ya >> e >> xb >> e >> yb >> e >> xc >> e >> yc >> e >>e >> xd >> e >> yd ){

    P a(xa , ya);
    P b(xb , yb);
    P c(xc , yc);
    P d(xd , yd);

    if(isIntersect(a,c,b,d) > 0 || isIntersect(b,d,a,c) > 0){
      cout << "NO" <<endl;
    }else cout << "YES" << endl; 


}
  return 0;
}

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(){

	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd){

		double a=(xc-xa)*(yd-ya)-(yc-ya)*(xd-xa);
		double b=(xc-xa)*(yb-ya)-(yc-ya)*(xb-xa);
		double c=(xd-xb)*(ya-yb)-(yd-yb)*(xa-xb);
		double d=(xd-xb)*(yc-yb)-(yd-yb)*(xc-xb);


		if(a*b<=0.0 && c*d<=0.0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

double outer_product (double* x, double* y, int i) {
  return (x[i] - x[(i+3)%4]) * (y[i] - y[(i+1)%4]) - (y[(i+3)%4] - y[i]) * (x[(i+1)%4] - x[i]);
}

int main () {
  double x[4], y[4];
  double z0;
  bool success;

  while (cin >> x[0]) {
    cin.ignore();
    cin >> y[0];
    for (int i = 1; i <= 3; i++) {
      cin.ignore();
      cin >> x[i];
      cin.ignore();
      cin >> y[i];
    }
    success = true;

    z0 = outer_product(x, y, 0);
    for (int i = 1; i < 4; i++) {
      if (outer_product(x, y, i) * z0 < 0) {
        success = false;
      }
    }

    if(success)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

bool check(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
	double res1 = (y2-y1)*(x3-x1)/(x2-x1)-(y3-y1), res2 = (y2-y1)*(x4-x1)/(x2-x1)-(y4-y1);
	if (res1 > 0 && res2 > 0) return false;
	if (res1 < 0 && res2 < 0) return false;
	if (res1 == 0 || res2 == 0) return false;
	return true;

}
int main() {
	double a,b,c,d,e,f,g,h;
	while (scanf("%f,%f,%f,%f,%f,%f,%f,%f\n",a,b,c,d,e,f,g,h)!=EOF) {
		if (check(a,b,e,f,c,d,g,h) && check(c,d,g,h,a,b,e,f)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}