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

int main()
{
  double x1,y1,x2,y2,x3,y3,x4,y4;
  double d12,d23,d34,d41,s1223,s2334,s3441,s4112,a1223,a2334,a3441,a4112;
  bool f;
  while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)){
    d12=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
    d23=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
    d34=sqrt((x4-x3)*(x4-x3)+(y4-y3)*(y4-y3));
    d41=sqrt((x1-x4)*(x1-x4)+(y1-y4)*(y1-y4));

    s1223=(x2-x1)*(x3-x2)+(y2-y1)*(y3-y2);
    s2334=(x3-x2)*(x4-x3)+(y3-y2)*(y4-y3);
    s3441=(x4-x3)*(x1-x4)+(y4-y3)*(y1-y4);
    s4112=(x1-x4)*(x2-x1)+(y1-y4)*(y2-y1);

    a1223=acos(s1223/(d12*d23));
    a2334=acos(s2334/(d23*d34));
    a3441=acos(s3441/(d34*d41));
    a4112=acos(s4112/(d41*d12));

    f=true;
    if(a1223>M_PI_2||a2334>M_PI_2||a3441>M_PI_2||a4112>M_PI_2)f=false;
    puts(f?"YES":"NO");
  }
}

C++: #include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;

const double EPS = 1e-12;

double add(double a, double b) {
	if (abs(a + b) < EPS * (abs(a) + abs(b)))
		return 0;
	return a + b;
}

struct P {
	double x, y;
	P() {};
	P(double x, double y) : x(x), y(y) {
	}

	P operator + (P p) {
		return P(add(x, p.x), add(y, p.y));
	}

	P operator - (P p) {
		return P(add(x, -p.x), add(y, -p.y));
	}

	P operator * (double d) {
		return P(x * d, y * d);
	}

	P operator / (double d) {
		return P(x / d, y / d);
	}

	// 内積
	double dot(P p) {
		return add(x * p.x, y * p.y);
	}

	// 外積
	double det(P p) {
		return add(x * p.y, -y * p.x);
	}
};

// 線分上に点があるか
bool on_seg(P p1, P p2, P q) {
	return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0;
}

// 直線と直線の交点
P intersection(P p1, P p2, P q1, P q2) {
	return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}

// 2直線の直行判定
bool line_orth(P a1, P a2, P b1, P b2) {
	return fabs((a1 - a2).dot(b1 - b2)) < EPS;
}

// 2直線の平行判定
bool line_paral(P a1, P a2, P b1, P b2) {
	return fabs((a1 - a2).det(b1 - b2)) < EPS;
}

// 進行方向
int ccw(P a, P b, P c) {
	b = b - a; c = b - c;
	if (b.det(c) > 0)
		return +1;
	else if (b.det(c) < 0)
		return -1;
	return 0;
}

int main(void) {
	string str;
	P p[4];
	while (getline(cin, str)) {
		replace(str.begin(), str.end(), ',', ' ');
		stringstream buf(str);
		for (int i = 0; i < 4; i++) {
			buf >> p[i].x >> p[i].y;
		}

		int cnt = 0, n = 4;
		for (int i = 0; i < 4; i++) {
			int c = ccw(p[i], p[(i+1)%4], p[(i+2)%4]);
			cnt += c;
			n += abs(c) - 1;
		}

		cout << cnt << " " << n << endl;
		cout << (abs(cnt) == n ? "YES" : "NO") << endl;
	}
}

C++: #include<cstdio>
#include<cmath>
int main(){
    double x[4],y[4];
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf\n",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3])!=-1){
        bool is=true;
        double radsum=0;
        for(int i=0;i<4;i++){
            int a=i,b=(i+1)%4,c=(i+2)%4;
            radsum+=acos((pow(x[a]-x[b],2)+pow(y[a]-y[b],2)+pow(x[b]-x[c],2)+pow(y[b]-y[c],2)-pow(x[c]-x[a],2)-pow(y[c]-y[a],2))/(2*sqrt(pow(x[a]-x[b],2)+pow(y[a]-y[b],2))*sqrt(pow(x[b]-x[c],2)+pow(y[b]-y[c],2))));
        }
        if(radsum<M_PI*2)printf("NO\n");
        else printf("YES\n");
    }
}

C++: #include<cstdio>
#include<cmath>

int main(){
	double a[4][2];
	double d[4];
	bool f = 0;
	int count;
	while(1 + scanf("%lf,%lf,", &a[0][0], &a[0][1])){
		count = 0;
		for(int i = 1; i < 4; i++){
			scanf("%lf,%lf,", &a[i][0], &a[i][1]);
		}
		for(int i = 0; i < 4; i++){
			d[i] = atan2(a[i][0] - a[(i+1)%4][0],a[i][1] - a[(i+1)%4][1]);
		}
		for(int i = 0; i < 4; i++){
			if(0 < sin(d[i] - d[(i+1)%4])){
				count++;
			}else{
				count--;
			}
		}
		if(count / 3){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
  double dot[5][2],vec[4][2],edge[4],ang[4],all;
  for(;;){
    if(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&dot[0][0],&dot[0][1],&dot[1][0],&dot[1][1],&dot[2][0],&dot[2][1],&dot[3][0],&dot[3][1]) == EOF){break;}
    dot[4][0] = dot[0][0];
    dot[4][1] = dot[0][1];
    for(int i=0; i<4; i++){
      vec[i][0] = dot[i+1][0]-dot[i][0];
      vec[i][1] = dot[i+1][1]-dot[i][1];
      edge[i] = sqrt(vec[i][0]*vec[i][0]+vec[i][1]*vec[i][1]);
    }
    ang[0] = acos(-(vec[0][0]*vec[3][0]+vec[0][1]*vec[3][1])/(edge[0]*edge[3]));
    ang[1] = acos(-(vec[1][0]*vec[0][0]+vec[1][1]*vec[0][1])/(edge[1]*edge[0]));
    ang[2] = acos(-(vec[2][0]*vec[1][0]+vec[2][1]*vec[1][1])/(edge[2]*edge[1]));
    ang[3] = acos(-(vec[3][0]*vec[2][0]+vec[3][1]*vec[2][1])/(edge[3]*edge[2]));
    all = ang[0]+ang[1]+ang[2]+ang[3];
    if(all < 6.283){cout <<"NO"<<endl;}
    else{cout <<"YES"<<endl;}
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	double xa, ya, xb, yb, xc, yc, xd, yd;
	

#if INPUT_FROM_FILE
	//std::ifstream ifs("test.txt");
	FILE *fp = fopen("test.txt", "r");
#endif


#if INPUT_FROM_FILE
	while(fscanf(fp, "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF){
#else
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF){
#endif
		double calc0 = (xb - xa) * (yc - yb) - (xc - xb) * (yb - ya);
		double calc1 = (xc - xb) * (yd - yc) - (xd - xc) * (yc - yb);
		double calc2 = (xd - xc) * (ya - yd) - (xa - xd) * (yd - yc);
		double calc3 = (xa - xd) * (yb - ya) - (xb - xa) * (ya - yd);

		if((calc0 > 0 && calc1 > 0 && calc2 > 0 && calc3 > 0) ||
			(calc0 < 0 && calc1 < 0 && calc2 < 0 && calc3 < 0)){
			std::cout << "YES" << std::endl;
		}
		else{
			std::cout << "NO" << std::endl;
		}
	}

	return 0;
}