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>

using namespace std;

struct Vector {
        double x;
        double y;
};

bool is_c_inner(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) {
    Vector ab = Vector{xb - xa, yb - ya};
    Vector bc = Vector{xc - xb, yc - yb};

    Vector bd = Vector{xd - xb, yd - yb};
    Vector dc = Vector{xc - xd, yc - yd};

    Vector da = Vector{xa - xd, ya - yd};
    Vector ac = Vector{xc - xa, yc - ya};

    double cross_product_1 = ab.x * bc.y - ab.y * bc.x;
    double cross_product_2 = bd.x * dc.y - bd.y * dc.x;
    double cross_product_3 = da.x * ac.y - da.y * ac.x;

    return (cross_product_1 >  0 && cross_product_2 >  0 && cross_product_3 >  0) ||
            (cross_product_1 <  0 || cross_product_2 <  0 && cross_product_3 <  0);
}

int main() {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    string result;
    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) == 8) {
        if(is_c_inner( xa, ya, xb, yb, xc, yc, xd, yd)
                || is_c_inner(xb, yb, xc, yc, xd, yd, xa, ya)
                || is_c_inner(xc, yc, xd, yd, xa, ya, xb, yb)
                || is_c_inner(xd, yd, xa, ya, xb, yb, xc, yc)
                ) {
            result = "NO"; // no convex
        } else {
            result = "YES"; //convex
        }
        cout << result << endl;
    }
    return 0;
}

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

int main(){
	double x[4],y[4];
	char c;
	while(cin>>x[1]>>c>>y[1]>>c>>x[2]>>c>>y[2]>>c>>x[3]>>c>>y[3]>>c>>x[4]>>c>>y[4]){
		double a[4],b[4];
		for(int i=0;i<4;i++){
			a[i] = x[(i+1)%4]-x[i];
			b[i] = y[(i+1)%4]-y[i];
		}
		double c[4];
		for(int i=0;i<4;i++) c[i] = a[i]*b[(i+1)%4] - a[(i+1)%4]*b[i];
		int d = 0;
		for(int i=0;i<4;i++) if(c[i]>0.0) d++;
		if(d==4 or d==-4) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
}

C++: #include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;

double dot(P a, P b) {
  return (a.real() * b.real() + a.imag() * b.imag());
}
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
using namespace std;

int main(){

	double x[4];
	double y[4];
	char cm;
	while(cin>>x[0]){
		cin>>cm;
		cin>>y[0];
		for(int i = 1; i < 4; i++){
			cin>>cm>>x[i]>>cm>>y[i];
		}
		// ツつサツづェツつシツづェツづ個角ツづ個角ツ度ツづーツ計ツ算ツつオツ、180ツ度ツづーツ越ツつヲツづゥツ角ツ度ツつェツ堕カツ催敖つキツづェツづ篠、ツつュツづ堋づアツづつ「ツづゥ
		P A1(x[1]-x[0],y[1]-y[0]);
		P A2(x[3]-x[0],y[3]-y[0]);
		P B1(x[2]-x[1],y[2]-y[1]);
		P B2(x[0]-x[1],y[0]-y[1]);
		P C1(x[3]-x[2],y[3]-y[2]);
		P C2(x[1]-x[2],y[1]-y[2]);
		P D1(x[0]-x[3],y[0]-y[3]);
		P D2(x[2]-x[3],y[2]-y[3]);
		double t1=cross(A1,A2);
		double t2=cross(B1,B2);
		double t3=cross(C1,C2);
		double t4=cross(D1,D2);
		if(cross(A1,A2)*cross(B1,B2)*cross(C1,C2)*cross(D1,D2)<0){
			cout<<"NO"<<endl;
		}
		else
			cout<<"YES"<<endl;
	}

	return 0;
}

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

class Coord{
public:
	const double x, y;
	
	Coord(double x, double y):x(x), y(y){}
	Coord(const Coord& c):x(c.x),y(c.y){}
	
	Coord operator-(const Coord& rhs) const{
		/*Coord temp;
		temp.x = this->x - rhs.x;
		temp.y = this->y - rhs.y;*/
		Coord temp(this->x - rhs.x, this->y - rhs.y);
		return temp;
	}
	/*
	Coord& operator=(const Coord& rhs){
		this->x = rhs.x;
		this->y = rhs.y;
		return *this;
	}
	*/
};

typedef Coord Vector2D;

class Square{
	std::vector<Coord*> points;

public:
	Square(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd){
		points.push_back(new Coord(xa, ya));
		points.push_back(new Coord(xb, yb));
		points.push_back(new Coord(xc, yc));
		points.push_back(new Coord(xd, yd));
	}
	bool isInTriangle(Coord* A, Coord* B, Coord* C, Coord* P){
	// 点と三角形の当たり判定( 内外判定 )
	// http://www.sousakuba.com/Programming/gs_hittest_point_triangle.html
	
		Vector2D AB(*B - *A);
		Vector2D BP(*P - *B);
		
		Vector2D BC(*C - *B);
		Vector2D CP(*P - *C);
		
		Vector2D CA(*A - *C);
		Vector2D AP(*P - *A);
		
		//外積    Z成分だけ計算すればよいです
		double c1 = AB.x * BP.y - AB.y * BP.x;
		double c2 = BC.x * CP.y - BC.y * CP.x;
		double c3 = CA.x * AP.y - CA.y * AP.x;
		
		if( ( c1 > 0 && c2 > 0 && c3 > 0 ) || ( c1 < 0 && c2 < 0 && c3 < 0 ) ) {
		    //三角形の内側に点がある
		    return true;
		}
		
		//三角形の外側に点がある
		return false;
	}
	bool isConvex(void){
		for(int i=0; i<points.size(); i++){
			std::vector<Coord*> triangle;
			for(int j=0; j<points.size(); j++){
				if(j != i){
					triangle.push_back(points[j]);
				}
			}
			if( isInTriangle(triangle[0], triangle[1], triangle[2], points[i]) ){
				return true;
			}
		}
		return false;
	}
};

int main(void){
	double xa, ya, xb, yb, xc, yc, xd, yd;
	char c;//cammma
	while (std::cin >> xa >> c >> ya >> c >> xb >> c >> yb >> c >> xc >> c >> yc >> c >> xd >> c >> yd) {
		Square* s = new Square(xa, ya, xb, yb, xc, yc, xd, yd);
		if( s->isConvex() ){
			std::cout << "NO" << std::endl;//凹みがあれば NO
		}else{
			std::cout << "YES" << std::endl;//凹みがなければ YES
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
static const double PI=6*asin(0.5);

double x[5],y[5];
char tmp;
double h[6];
double ang[8];//0:bac 1:bca 2:acd 3:cad 4:cba 5:cdb 6:bda 7:dba


int main(){
	while(cin>>x[0]>>tmp>>y[0]){
		bool flag=true;
		rep(i,3){
			cin>>tmp>>x[i+1]>>tmp>>y[i+1];
		}
		x[4] = x[0]; y[4] = y[0];
		rep(i,4){
			double X = x[i+1]-x[i],Y = y[i+1]-y[i];
			h[i] = sqrt(X*X+Y*Y);
			//cout << "h["<<i<<"] = "<<h[i]<<endl;
		}
		//cout<<acos(0.5)<<endl;
		h[4] = sqrt((x[2]-x[0])*(x[2]-x[0])+(y[2]-y[0])*(y[2]-y[0]));
		h[5] = sqrt((x[3]-x[1])*(x[3]-x[1])+(y[3]-y[1])*(y[3]-y[1]));
		ang[0] = acos((h[0]*h[0]+h[4]*h[4]-h[1]*h[1])/(2*h[0]*h[4]));
		ang[1] = acos((h[1]*h[1]+h[4]*h[4]-h[0]*h[0])/(2*h[1]*h[4]));
		ang[2] = acos((h[2]*h[2]+h[4]*h[4]-h[3]*h[3])/(2*h[2]*h[4]));
		ang[3] = acos((h[3]*h[3]+h[4]*h[4]-h[2]*h[2])/(2*h[3]*h[4]));
		ang[4] = acos((h[1]*h[1]+h[5]*h[5]-h[2]*h[2])/(2*h[1]*h[5]));
		ang[5] = acos((h[2]*h[2]+h[5]*h[5]-h[1]*h[1])/(2*h[2]*h[5]));
		ang[6] = acos((h[4]*h[4]+h[3]*h[3]-h[0]*h[0])/(2*h[4]*h[3]));
		ang[7] = acos((h[0]*h[0]+h[4]*h[4]-h[3]*h[3])/(2*h[0]*h[4]));
		//cout << (h[0]*h[0]+h[4]*h[4]-h[1]*h[1])/(2*h[0]*h[4])<<endl;
		//rep(i,4) cout<<ang[i]<<endl;
		//cout<<2*ang[0]<<" "<<PI<<endl;
		if(PI>(ang[0]+ang[3])&&PI>ang[1]+ang[2]){
			
		}
		else{
			flag = false;
		}
		if(PI>(ang[4]+ang[7])&&PI>ang[5]+ang[7]){
		}
		else{
			flag = false;
		}
		if(flag) cout<<"YES\n";
		else cout<<"NO\n";
		
	}
	return 0;
}