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<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;

 const int maxn = 100000;
 struct Point
 {
    double x,y;
    Point() {}
    Point(double _x, double _y) {
        x = _x;
        y = _y;
    }

    Point operator -(const Point &B) const {
        return Point(x-B.x, y-B.y);
    }

 }p[maxn];

 double eps = 1e-10;
 
 int dcmp(double x)
 {
    if(fabs(x) < eps) return 0;
    else return x < 0 ? -1 : 1;
 }
 
 double Cross(Point A, Point B)
 {
    return A.x*B.y - A.y*B.x;
 }
 
 bool isConvex(Point *p, int n)
 {
    p[n] = p[0]; 
    p[n+1] = p[1]; 
    int now = dcmp(Cross(p[1]-p[0], p[2]-p[1]));
    for(int i = 1; i < n; i++)
    {
        int next = dcmp(Cross(p[i+1]-p[i], p[i+2]-p[i+1]));
        if(now*next < 0)
        {
            return false;
        }
        now = next; 
    }
    return true;
 }
 
 int main()
 {
    int n=4;
    while(cin>>p[0].x>>p[0].y)
    {
        for(int i = 1; i < 4; i++)
            scanf("%lf%lf", &p[i].x, &p[i].y);
        bool flag = isConvex(p,n);
        if(flag) printf("YES\n");
        else printf("NO\n");
    }
    //while(1);
    return 0;
 }

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

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]){
		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==0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

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<iostream>
#include<cstdio>
using namespace std;
struct POS{
  double x;
  double y;
};
bool cross(POS a, POS b, POS c, POS d);
int main(){
  POS a,b,c,d;
  for(;;){
    if(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)) == EOF) break;
    if(cross(a,c,b,d) && cross(b,d,a,c)) cout <<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  return 0;
}
bool cross(POS a, POS b, POS c, POS d){
  POS v,w,u;
  v.x = a.x-b.x;
  v.y = a.y-b.y;
  w.x = c.x-b.x;
  w.y = c.y-b.y;
  u.x = d.x-b.x;
  u.y = d.y-b.y;
  return (v.x*w.y-v.y*w.x)*(v.x*u.y-v.y*u.x)<0;
}

C++: #include<iostream>
#include<cmath>
struct vector
{
	double x, y;
	double norm()
	{
		return hypot(x, y);
	}
	vector operator-(vector v)
	{
		vector result;
		result.x = x - v.x;
		result.y = y - v.y;
		return result;
	}
	double operator*(vector v)
	{
		return x * v.x + y * v.y;
	}
};
double area(vector v1, vector v2, vector v3)
{
	vector side1 = v2 - v1, side2 = v3 - v1;
	return sqrt(pow(side1.norm() * side2.norm(), 2) - pow(side1 * side2, 2)) / 2;
}
int main()
{
	while (true)
	{
		vector A, B, C, D;
		char foo;
		std::cin >> A.x >> foo >> A.y >> foo >> B.x >> foo >> B.y >> foo >> C.x >> foo >> C.y >> foo >> D.x >> foo >> D.y;
		if (std::cin.eof())
		{
			break;
		}
		double ABC = area(A, B, C),
			ACD = area(A, C, D),
			BCD = area(B, C, D),
			ABD = area(A, B, D);
		std::cout << (ABC + ACD > ABD && ABC + ACD > BCD && ABD + BCD > ABC && ABD + BCD > ACD ? "YES" : "NO") << std::endl;
	}
	return 0;
}