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<cstdio>
#include<algorithm>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<list>
#include<stack>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;

struct Point{
	double x,y;
	Point(){}
	Point(double _x,double _y){
		x=_x; y=_y;
	}
};

struct Line{
	double x[2],y[2];
	Line(){}
	Line(Point p,Point q){
		x[0]=p.x; x[1]=q.x;
		y[0]=p.y; y[1]=q.y;
	}
};

void RevXY(Point &p){
	swap(p.x,p.y);
}

void RevXY(Line &l){
	for(int i=0;i<2;i++) swap(l.x[i],l.y[i]);
}

bool Is_SameSide(Line l,Point p,Point q){
	//printf("%lf,%lf - %lf,%lf\np(%lf,%lf),q(%lf,%lf)\n",l.x[0],l.y[0],l.x[1],l.y[1],p.x,p.y,q.x,q.y);
	if(l.x[1]==l.x[0]){
		RevXY(l); RevXY(p); RevXY(q);
	}
	double a,b;
	a = (l.y[1]-l.y[0])/(l.x[1]-l.x[0]);
	b = l.y[0]-a*l.x[0];
	//printf("%lf,%lf - %lf,%lf : y = %lfx+(%lf)\np(%lf,%lf),q(%lf,%lf)\n",l.x[0],l.y[0],l.x[1],l.y[1],a,b,p.x,p.y,q.x,q.y);
	if((p.y-(a*p.x+b))*(q.y-(a*q.x+b))>0) return true;
	else return false;
}

int main(){
	Point S[4];
	while(scanf("%lf,%lf",&S[0].x,&S[0].y)!=EOF){
		Point sum = Point(S[0].x,S[0].y);
		for(int i=1;i<4;i++){
			scanf(",%lf,%lf",&S[i].x,&S[i].y);
			sum.x += S[i].x; sum.y += S[i].y;
		}
		bool ans=true;
		for(int i=0;i<4;i++){
			if(Is_SameSide(Line(S[i],S[(i+2)%4]),S[(i+1)%4],Point((sum.x-S[(i+1)%4].x)/3,(sum.y-S[(i+1)%4].y)/3))==true){
				ans = false;
			}
		}
		if(ans) puts("YES");
		else puts("NO");
	}
}

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

double Heron(double,double,double);

int main(){
	double x[4],y[4];
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3])!=EOF){
		double l01 = sqrt((x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0]));
		double l02 = sqrt((x[2]-x[0])*(x[2]-x[0])+(y[2]-y[0])*(y[2]-y[0]));
		double l03 = sqrt((x[3]-x[0])*(x[3]-x[0])+(y[3]-y[0])*(y[3]-y[0]));
		double l12 = sqrt((x[2]-x[1])*(x[2]-x[1])+(y[2]-y[1])*(y[2]-y[1]));
		double l13 = sqrt((x[1]-x[3])*(x[1]-x[3])+(y[1]-y[3])*(y[1]-y[3]));
		double l23 = sqrt((x[3]-x[2])*(x[3]-x[2])+(y[3]-y[2])*(y[3]-y[2]));
		if(fabs((Heron(l01, l12, l02)+Heron(l02, l23, l03))-(Heron(l13, l01, l03)+Heron(l13, l12, l23)))<1){
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
}

double Heron(double a,double b,double c){
	double s=(a+b+c)/2;
	return sqrt(s*(s-a)*(s-b)*(s-c));
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<iomanip>
using namespace std;
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

class Point{
	public:
		double x, y;

		Point(double x = 0, double y = 0): x(x), y(y) {}

		Point operator + (Point p){ return Point(x + p.x, y + p.y);}
		Point operator - (Point p){ return Point(x - p.x, y - p.y);}
		Point operator * (double a){ return Point(a * x, a * y);}
		Point operator / (double a){ return Point(x / a, y / a);}

		double abs(){ return sqrt(norm());}
		double norm(){ return x * x + y * y;}

		bool operator < (const Point &p) const{
			return x != p.x ? x < p.x : y < p.y;
		}

		bool operator == (const Point &p) const{
			return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
		}
};

typedef Point Vector;

double dot(Vector a, Vector b){
	return a.x * b.x + a.y * b.y;
}
double cross(Vector a, Vector b){
	return a.x * b.y - a.y * b.x;
}
int ccw(Point p0, Point p1, Point p2){
	Vector a = p1 - p0;
	Vector b = p2 - p0;
	if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
	if(cross(a, b) < -EPS) return CLOCKWISE;
	if(dot(a, b) < -EPS) return ONLINE_BACK;
	if(a.norm() < b.norm()) return ONLINE_FRONT;

	return ON_SEGMENT;
}
int main(){
	char line[100];
	while(fgets(line, sizeof(line), stdin) != NULL){
		Point p[6];
		sscanf(line, "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &p[0].x, &p[0].y, &p[1].x, &p[1].y, &p[2].x, &p[2].y, &p[3].x, &p[3].y);
		p[4] = p[0], p[5] = p[1];
		bool is_counter_clockwise;
		if(ccw(p[0], p[1], p[2]) == 1) is_counter_clockwise = true;
		else is_counter_clockwise = false;
		bool flag = true;
		if(is_counter_clockwise){
			for(int i = 1; i <= 4; i++){
				if(ccw(p[i - 1], p[i], p[i + 1]) != 1) flag = false;
			}
		}else{
			for(int i = 1; i <= 4; i++){
				if(ccw(p[i - 1], p[i], p[i + 1]) != -1) flag = false;
			}
		}
		if(flag) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#define STRMAX 200
#define PNUM 4

using namespace std;

class Point{
  public:
    double x, y;
  public:
    bool isLeft( Point *p, Point *q );
};
enum State{
  NONE,
  LEFT,
  RIGHT
};
bool Point::isLeft( Point *p, Point *q ){
  double x1 = p->x - this->x;
  double x2 = q->x - this->x;
  double y1 = p->y - this->y;
  double y2 = q->y - this->y;
  return (x1 * y2 - x2 * y1 > 0) ? true : false;
}

void c2s( char str[] ){
  for( int i = 0; str[ i ] != '\0'; i++ ){
    str[ i ] = ( ( str[ i ] == ',' ) ? ' ' : str[ i ] );
  }
}

int main(){
  char str[ STRMAX ];
  Point *p[ PNUM ] = { NULL, NULL, NULL, NULL };
  while( scanf( "%s", str ) != EOF ){
    c2s( str );
      for( int i = 0; i < PNUM; i++ ){
        if( p[ i ] == NULL ){
          delete p[ i ];
        }
        p[ i ] = new Point();
      }
      sscanf(
          str,
          "%lf%lf%lf%lf%lf%lf%lf%lf", 
          &(p[ 0 ]->x), 
          &(p[ 0 ]->y), 
          &(p[ 1 ]->x), 
          &(p[ 1 ]->y), 
          &(p[ 2 ]->x), 
          &(p[ 2 ]->y), 
          &(p[ 3 ]->x), 
          &(p[ 3 ]->y) 
     );
     State state = NONE;
     bool ok = true;
     for( int i = 0; i < PNUM; i++ ){
        State s = LEFT;
        if( !p[(i+2)%PNUM]->isLeft( p[i%PNUM], p[(i+1)%PNUM] ) ){
          s = RIGHT;
        }
        if( state != NONE && state != s ){
          ok = false;
          break;
        }
        state = s;
     }
     puts( ok ? "YES" : "NO" );
  }

  return EXIT_SUCCESS;
}

C++: #include <iostream>
#define N 4
using namespace std;
int main(){
	double x[N], y[N];
	char c;
	while(cin >> x[0] >> c >> y[0]){
		for(int i = 1; i < N; i++){
			cin >> c >> x[i] >> c >> y[i];
		}
		double r[N][2], z[4];
		for(int i = 0; i < N; i++){
			r[i][0] = x[(i+1)%N] - x[i];
			r[i][1] = y[(i+1)%N] - y[i];
		}
		for(int i = 0; i < N; i++){
			z[i] = r[i][0]*r[(i+1)%N][1]-r[(i+1)%N][0]*r[i][1];
		}
		if(z[0]*z[1]*z[2]*z[3] > 0) cout << "YES" << endl;	//??°???????¬????????????????????????°NO
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double a[2],b[2],c[2],d[2];
  for(;;){
    bool f = false;
    if(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a[0],&a[1],&b[0],&b[1],&c[0],&c[1],&d[0],&d[1]) == EOF) break;
    if(((a[0]-c[0])*(b[0]-c[0])-(a[1]-c[1])*(b[1]-c[1]))*((a[0]-c[0])*(d[0]-c[0])-(a[1]-c[1])*(d[1]-c[1]))>0) f = true;
    if(((b[0]-d[0])*(a[0]-d[0])-(b[1]-d[1])*(a[1]-d[1]))*((b[0]-d[0])*(c[0]-d[0])-(b[1]-d[1])*(c[1]-d[1]))>0) f = true;
    if(f) cout <<"NO"<<endl;
    else cout <<"YES"<<endl;
  }
  return 0;
}