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<vector>
#include <algorithm>
#include <complex>
using namespace std;

typedef long long int lli;
const double EPS = 1e-10;
template<class T>
bool eq(const T& a, const T& b) {return abs(a - b) < EPS;}

typedef  complex<double> point;
// sort/unique用、setではうまく動かないので使うべからず
namespace std {
	bool operator==(const point &a, const point &b){
		return eq(a, b);
	}
	bool operator<(const point& a, const point& b) {
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}
double cross(const point& a, const point& b) {
	return imag(conj(a)*b);
}
double dot(const point& a, const point& b) {
	return real(conj(a)*b);
}

int ccw(point a, point b, point 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;  // a--c--b on line or a----bc
}


typedef vector<point> polygon;

//凸包
//点集合 ps に対してその凸包を求める．
//O(n log n)
polygon convex_hull(polygon ps) {
  int n=ps.size(), k=0;
  sort(ps.begin(), ps.end());
  polygon 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;
}

//凸性判定
//与えられた多角形 P が凸かどうかを判定する．一周回ってみて，右向きの辺がないことを確かめればよい．
//O(n)
bool isconvex(const polygon &P) {
  for (int i = 0; i < P.size(); ++i)
    if (ccw(P[(i+P.size()-1) % P.size()], P[(i) % P.size()], P[(i+1) % P.size()]) > 0) return false;
  return true;
}


int main()
{
  double x,y;
  char aa;
  for(;cin>>x>>aa>>y;)
    {
      polygon a;
      a.push_back(point(x,y));
      //      cout<<x<<" "<<y;
      for(int i=0;i<3;i++)
	{
	  char aa;
	  cin>>aa>>x>>aa>>y;
	  a.push_back(point(x,y));
	  //	  cout<<" "<<x<<" "<<y;
	}
      //cout<<endl<<endl;
      cout<<((isconvex(a)||isconvex(polygon(a.rbegin(),a.rend())))?"YES":"NO")<<endl;
    }

}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;


double dist(double x1,double y1,double x2,double y2){

    return sqrt( (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1) );

}

double deg(double a,double b,double c){

    return acos( (a*a + b*b - c*c ) / (2 * a * b ) );

}

double calc_deg(double x1,double y1,double x2,double y2,double x3,double y3){

    double x,y,z;

    x = dist(x1,y1,x2,y2);
    y = dist(x2,y2,x3,y3);
    z = dist(x3,y3,x1,y1); 

    return deg(x,y,z);

}


int main(){

    double x1,y1,x2,y2,x3,y3,x4,y4;
    char c;

    while(cin >> x1 >> c >> y1 >> c >> x2 >> c >> y2 >> c >> x3 >> c >> y3 >> c >> x4 >> c >> y4){

        double deg1,deg2,deg3,deg4;

        deg1 = calc_deg(x1,y1,x2,y2,x3,y3);
        deg2 = calc_deg(x2,y2,x3,y3,x4,y4);
        deg3 = calc_deg(x3,y3,x4,y4,x1,y1);
        deg4 = calc_deg(x4,y4,x1,y1,x2,y2);


        if(abs(deg1 + deg2 + deg3 + deg4 - 2*M_PI) < 0.00001){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }


    }
    return 0;

}

C++: #include<iostream>
int main()
{
	while (true)
	{
		double xa, ya, xb, yb, xc, yc, xd, yd;
		char foo;
		std::cin >> xa >> foo >> ya >> foo >> xb >> foo >> yb >> foo >> xc >> foo >> yc >> foo >> xd >> foo >> yd;
		if (std::cin.eof())
		{
			break;
		}
		const double A_C = hypot(xa - xc, ya - yc);
		const double B_D = hypot(xb - xd, yb - yd);
		const double AC_B = abs(((yc - ya)*(xb - xc) - (xc - xa)*(yb - yc)) / hypot(yc - ya, xc - xa));
		const double BD_A = abs(((yd - yb)*(xa - xd) - (xd - xb)*(ya - yd)) / hypot(yd - yb, xd - xb));
		std::cout << (A_C > BD_A&&B_D > AC_B ? "YES" : "NO") << std::endl;
	}
	return 0;
}

C++: #include<iostream>

struct Point
{
	double x;

	double y;
};

double Abs(double x)
{
	return x>=0 ? x : -x; 
}

double Square(const Point& P, const Point& Q, const Point& R)
{
	Point A = {Q.x-P.x, Q.y-P.y};

	Point B = {R.x-P.x, R.y-P.y};

	return Abs(A.x*B.y-A.y*B.x); 
}

bool JudgeS(const Point& P, const Point& Q, const Point R, const Point O)//P,Q,R,Sが四角形になる准に
{
	return (Square(P, Q, R) > Square(O, P, Q) + Square(Q, R, O));
}

int main()
{
	Point A, B, C, D;

	char c;

	while(std::cin >> A.x >> c >> A.y >> c >> B.x >> c >> B.y >> c 
			>> C.x >> c >> C.y >> c >> D.x >> c >> D.y)
	{
		if(JudgeS(A,B,C,D) || JudgeS(B,C,D,A) || JudgeS(C,D,A,B) || JudgeS(D,A,B,C))
		{
			std::cout << "NO\n";
		}
		else
		{
			std::cout << "YES\n";
		}
	}
}

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

#define scanf scanf_s

struct p {
	double x;
	double y;
};

int check(p a, p b, p c, p d) {
	if (((a.x-b.x)*(c.y-a.y)+(a.y-b.y)*(a.x-c.x)) *
		((a.x-b.x)*(d.y-a.y)+(a.y-b.y)+(a.x-d.x))) {
		return 1;
	}
	return 0;
}

int main() {
	double x1, x2, x3, x4, y1, y2, y3, y4;
	while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) {
		p a, b, c, d;
		a.x = x1, a.y = y1;
		b.x = x2, b.y = y2;
		c.x = x3, c.y = y3;
		d.x = x4, d.y = y4;

		if (check(a,c,b,d) && check(b,d,a,c)) {
			cout << "NO";
		}else {
			cout << "YES";
		}
		cout << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<complex>
#include<cstdio>
#define EPS 1.0e-10
using namespace std;
typedef complex<double> P;
P a[4];
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
int is_intersected_ls(P a1, P a2, P b1, P b2) {
  return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
         ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}
int main(){
	double x,y;
	char c;
	while(scanf("%lf,%lf",&x,&y)!=EOF){
		a[0]=P(x,y);
		for(int i=1;i<4;i++){
			scanf(",%lf,%lf",&x,&y);;
			a[i]=P(x,y);
		}
		if(is_intersected_ls(a[0],a[2],a[1],a[3]))
		cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}