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 PI 3.14159265359
using namespace std;

int main() {
	typedef struct zahyou {
		double x, y;
	} z;

	z a, b, c, d;
	char ch;
	while (cin >> a.x) {
		cin >> ch >> a.y >> ch >> b.x >> ch >> b.y >> ch >> c.x >> ch >> c.y
		>> ch >> d.x >> ch >> d.y;
		//cout << a.x << ' ' << a.y << endl;
		//cout << b.x << ' ' << b.y << endl;
		//cout << c.x << ' ' << c.y << endl;
		//cout << d.x << ' ' << d.y << endl;

		int f = 0;
		double n, m;

		n = (a.x - c.x) * (b.y - a.y) - (a.y - c.y) * (b.x - a.x);
		m = (a.x - c.x) * (d.y - a.y) - (a.y - c.y) * (d.x - a.x);
		//cout << fixed << setprecision(4) << n << ' ' << m << endl;
		if (n * m > 0) f = 1;

		n = (b.x - d.x) * (a.y - b.y) - (b.y - d.y) * (a.x - b.x);
		m = (b.x - d.x) * (c.y - b.y) - (b.y - d.y) * (c.x - b.x);
		//cout << fixed << setprecision(4) << n << ' ' << m << endl;
		if (n * m > 0) f = 1;

		if (!f) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

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

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(){
	double x,y;
	point in[4],p[4];
	while(scanf("%lf,%lf,",&x,&y)!=EOF){	
		loop(i,1,4){
			if(i!=3)scanf("%lf,%lf,",&x,&y);
			else scanf("%lf,%lf",&x,&y);
			in[i]=point(x,y);
		}
		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>
using namespace std;
int main(void){

	double x1,x2,x3,x4,y1,y2,y3,y4, tmp1, tmp2, tmp3, tmp4;
	char c;
	while (cin>>x1>>c>>y1>>c>>x2>>c>>y2>>c>>x3>>c>>y3>>c>>x4>>c>>y4){
		tmp1 = (y2-y1)*(x3-x1)-(y3-y1)*(x2-x1);
		tmp2 = (y4-y1)*(x3-x1)-(y3-y1)*(x4-x1);
		
		tmp3 = (y1-y2)*(x4-x2)-(y4-y2)*(x1-x2);
		tmp4 = (y3-y2)*(x4-x2)-(y4-y2)*(x3-x2);
		if (tmp1*tmp2<0 && tmp3*tmp4<0) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

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

int main()
{
	const double PI = acos(-1);
	double x[4], y[4];
	complex<double> z[4];
	char c;

	while (cin >> x[0] >> c >> y[0] >> c >> x[1] >> c >> y[1] >> c
				>> x[2] >> c >> y[2] >> c >> x[3] >> c >> y[3]) {

		for (int i = 0; i < 4; i++) {
			z[i].real(x[i]);
			z[i].imag(y[i]);
		}

		bool f = 1;

		for (int i = 0; i < 4; i++) {
			int j = (i + 1) % 4, k = (i + 2) % 4;
			double t = arg((z[k] - z[j]) / (z[j] - z[i]));
			if (!(t >= 0 && t < PI)) {
				f = 0;
				break;
			}
		}

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

	return 0;
}

C++: #include <iostream>
#include <complex>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;
typedef complex<double> P;

#define X real()
#define Y imag()

double check(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(void)
{
    double x[4],y[4];
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",x,y,x+1,y+1,x+2,y+2,x+3,y+3)) {
        P a(x[0], y[0]);
        P b(x[1], y[1]);
        P c(x[2], y[2]);
        P d(x[3], y[3]);

        if(check(a,c,b,d) > 0.0 || check(b,d,a,c) > 0.0)
            puts("NO");
        else
            puts("YES");
    }

    return 0;
}

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

int main(){
	char trash;
	double x[4], y[4];
	while(cin >> x[0] >> trash >> y[0]){
		double p, q, r;
		for(int i = 1; i < 4; i++){
			cin >> trash >> x[i] >> trash >> y[i];
		}
		p = ((y[1]-y[0])*(x[3]-x[0])/(x[1]-x[0]))+y[0];
		q = ((y[2]-y[1])*(x[3]-x[1])/(x[2]-x[1]))+y[1];
		r = ((y[2]-y[0])*(x[3]-x[0])/(x[2]-x[0]))+y[0];
		if(x[0] == x[2]){
			if(x[0] > x[1]){
				if(x[0] > x[3]){
					cout << "NO" << endl;
				}
				else{
					if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){
						cout << "YES" << endl;
					}
					else{
						cout << "NO" << endl;
					}
				}
			}
			else{
				if(x[0] < x[3]){
					cout << "NO" << endl;
				}
				else{
					if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){
						cout << "YES" << endl;
					}
					else{
						cout << "NO" << endl;
					}
				}
			}
		}
		else if(x[0] == x[1]){
			if(x[0] > x[2]){
				if(x[0] < x[2]){
					cout << "NO" << endl;
				}
				else{
					if(x[0] > x[1]){
						if(q > y[3]){
							cout << "YES" << endl;
						}
						else{
							cout << "NO" << endl;
						}
					}
					else{
						if(q < y[3]){
							cout << "YES" << endl;
						}
						else{
							cout << "NO" << endl;
						}
					}
				}
			}
			else{
				if(x[0] > x[2]){
					cout << "NO" << endl;
				}
				else{
					if(x[0] > x[1]){
						if(q > y[3]){
							cout << "YES" << endl;
						}
						else{
							cout << "NO" << endl;
						}
					}
					else{
						if(q < y[3]){
							cout << "YES" << endl;
						}
						else{
							cout << "NO" << endl;
						}
					}
				}
			}
		}
		else if(x[1] == x[2]){
			if(x[0] > x[1]){
				if(x[1] > x[3]){
					cout << "NO" << endl;
				}
				else{
					if(x[2] > x[1]){
						if(p < y[3]){
							cout << "YES" << endl;
						}
						else{
							cout << "NO" << endl;
						}
					}
					else{
						if(p > y[3]){
							cout << "YES" << endl;
						}
						else{
							cout << "NO" << endl;
						}
					}
				}
			}
			else{
				if(x[1] < x[3]){
					cout << "NO" << endl;
				}
				else{
					if(p < y[3]){
						cout << "YES" << endl;
					}
					else{
						cout << "NO" << endl;
					}
				}
			}
		}
		else{
			if(r > y[1]){
				if(r > y[3]){
					cout << "NO" << endl;
				}
				else{
					if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){
						cout << "YES" << endl;
					}
					else{
						cout << "NO" << endl;
					}
				}
			}
			else{
				if(r < y[3]){
					cout << "NO" << endl;
				}
				else{
					if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){
						cout << "YES" << endl;
					}
					else{
						cout << "NO" << endl;
					}
				}	
			}
		}
	}
}