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<cmath>
using namespace std;
int main(){
	double a[2],b[2],c[2],d[2];
	double atob[2],btoc[2],ctod[2],dtoa[2];
	double edge_ab,edge_bc,edge_cd,edge_da;
	double angle_a,angle_b,angle_c,angle_d;
	for(;;){
		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;}
		atob[0] = b[0]-a[0];
		atob[1] = b[1]-a[1];
		btoc[0] = c[0]-b[0];
		btoc[1] = c[1]-b[1];
		ctod[0] = d[0]-c[0];
		ctod[1] = d[1]-c[1];
		dtoa[0] = a[0]-d[0];
		dtoa[1] = a[1]-d[1];
		edge_ab = sqrt(atob[0]*atob[0]+atob[1]*atob[1]);
		edge_bc = sqrt(btoc[0]*btoc[0]+btoc[1]*btoc[1]);
		edge_cd = sqrt(ctod[0]*ctod[0]+ctod[1]*ctod[1]);
		edge_da = sqrt(dtoa[0]*dtoa[0]+dtoa[1]*dtoa[1]);
		angle_a = acos(-(atob[0]*dtoa[0]+atob[1]*dtoa[1])/(edge_ab*edge_da));
		angle_b = acos(-(btoc[0]*atob[0]+btoc[1]*atob[1])/(edge_bc*edge_ab));
		angle_c = acos(-(ctod[0]*btoc[0]+ctod[1]*btoc[1])/(edge_cd*edge_bc));
		angle_d = acos(-(dtoa[0]*ctod[0]+dtoa[1]*ctod[1])/(edge_da*edge_cd));
		if(angle_a+angle_b+angle_c+angle_d >6.28318 && angle_a+angle_b+angle_c+angle_d <6.28319){cout <<"YES"<<endl;}
		else{cout<<"NO"<<endl;}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <stdio.h>
#include <math.h>
using namespace std;
int line(double x1,double y1,double x2,double y2,double xp,double yp){
	if(x1!=x2){
		y1=(y2-y1)*(xp-x1)/(x2-x1)+y1;
	}
	if(yp-y1>0) return 1;
	else return -1;
}
int main(){
	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF){
		int a,b,c,d;
		a=line(xb,yb,xd,yd,xa,ya);
		b=line(xa,ya,xc,yc,xb,yb);
		c=line(xb,yb,xd,yd,xc,yc);
		d=line(xa,ya,xc,yc,xd,yd);
		if(a+c==0 && b+d==0){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	double a,b,c,d,e,f,g,h;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h)!=EOF){
		if((a==c&&g==e&&d==f&&b==h)||(a==g&&c==e&&b==d&&h==f)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <complex>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef complex<double> p;
typedef pair<int, int> pii;
typedef long long ll;

double cross(p a, p b){
	
	return (a.real() * b.imag() - a.imag() * b.real());
}

string solve(vector<p> vc){

	bool sgo;
	
	for(int i=0; i<vc.size(); ++i){
		
		bool sg = cross(vc[i] - vc[(i+2)%vc.size()], vc[(i+1)%vc.size()] - vc[(i+2)%vc.size()]) > 0;
		
		if(i==0){
			sgo = sg;
		}
		
		if(sgo ^ sg)
			return "NO";
	}
	
	return "YES";
}
	

int main(){

	double x[4], y[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], !cin.eof()){
	
		vector<p> lct;
		
		for(int i=0; i<4; ++i){
			lct.push_back(p(x[i]+100.0, y[i]+100.0));
		}
		
		cout << solve(lct) << endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>

#define PI 3.14159265358979

using namespace std;

double f(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4)
{
	return ((x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

int main()
{
	int x[4],y[4];

	while(scanf("%f,%f,%f,%f,%f,%f,%f,%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3])!=EOF)
	{
		if(f(x[0],y[0],x[1],y[1],x[2],y[2],x[3],y[3])<0 || f(x[2],y[2],x[3],y[3],x[0],y[0],x[1],y[1])<0)cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int p(double x1, double x2, double x3, double x4) {
  return x1 * x4 - x2 * x3;
}

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]) != EOF) {
    double dt[4];
    for (int i = 0; i < 4; i++) {
      dt[i] = p(x[(i+1)%4]-x[i], y[(i+1)%4]-y[i], x[(i+2)%4]-x[i], y[(i+2)%4]-y[i]);
    }
    if ((dt[0] > 0 && dt[1] > 0 && dt[2] > 0 && dt[3] > 0) ||
        (dt[0] < 0 && dt[1] < 0 && dt[2] < 0 && dt[3] < 0)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }

  return 0;
}

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

int main(){
    double xa, ya, xb, yb, xc, yc, xd, yd;
    while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
                 &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yc) != EOF ){
        bool f1 = (((xb-xd)*(ya-yb)-(yb-yd)*(xa-xb))*
                    ((xb-xd)*(yc-yb)-(yb-yd)*(xc-xb)) < 0);
        bool f2 = (((xa-xc)*(yb-ya)-(ya-yc)*(xb-xa))*
                    ((xa-xc)*(yd-ya)-(ya-yc)*(xd-xa)) < 0);
        if( f1 && f2 ){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
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){
		if(x[0]==x[2]){
			if(x[0]<x[1]&&x[0]<x[3])
				cout<<"NO"<<endl;
			else if(x[0]>x[1]&&x[0]>x[3])
				cout<<"NO"<<endl;
			else cout<<"YES"<<endl;
		}
		else if(x[1]==x[3]){
			if(x[1]<x[0]&&x[1]<x[2])
				cout<<"NO"<<endl;
			else if(x[1]>x[0]&&x[1]>x[2])
				cout<<"NO"<<endl;
			else cout<<"YES"<<endl;
		}
		else {
			if(y[1]>((y[2]-y[0])/(x[2]-x[0]))*(x[1]-x[0])+y[0]&&y[3]>((y[2]-y[0])/(x[2]-x[0]))*(x[3]-x[0])+y[0])
			cout<<"NO"<<endl;
			else  if(y[1]<((y[2]-y[0])/(x[2]-x[0]))*(x[1]-x[0])+y[0]&&y[3]<((y[2]-y[0])/(x[2]-x[0]))*(x[3]-x[0])+y[0])
			cout<<"NO"<<endl;
			else if(y[0]>((y[3]-y[1])/(x[3]-x[1]))*(x[0]-x[1])+y[1]&&y[2]>((y[3]-y[1])/(x[3]-x[1]))*(x[2]-x[1])+y[1])
			cout<<"NO"<<endl;
			else if(y[0]<((y[3]-y[1])/(x[3]-x[1]))*(x[0]-x[1])+y[1]&&y[2]<((y[3]-y[1])/(x[3]-x[1]))*(x[2]-x[1])+y[1])
			cout<<"NO"<<endl;
			else cout<<"YES"<<endl;
		}
	}
	return 0;
}

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

struct Point{
  double x,y;
  void init(double a,double b){x=a;y=b;}
  bool turn(Point p){return (x*p.y - y*p.x)>=0;}
};

int main()
{
  Point A,B,C,D,AB,BC,CD,DA;
  while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&A.x,&A.y,&B.x,&B.y,&C.x,&C.y,&D.x,&D.y)){
    AB.init(B.x-A.x,B.y-A.y);
    BC.init(C.x-B.x,C.y-B.y);
    CD.init(D.x-C.x,D.y-C.y);
    DA.init(A.x-D.x,A.y-D.y);
    if( (AB.turn(BC)==BC.turn(CD))&&(BC.turn(CD)==CD.turn(DA))&&(CD.turn(DA)==DA.turn(AB)) )puts("YES");
    else puts("NO");
  }
}