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<string>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<numeric>
#include<vector>
#include<cstdio>
#include<cmath>
#include<climits>
#include<cfloat>
#include<cstring>
#define foreach(t,p,tit) for(t::iterator tit=p.begin();tit!=p.end();++tit)
#define rforeach(t,p) for(t::reverse_iterator it=p.rbegin();it!=p.rend();++it)
#define all(p) p.begin(),p.end()
#define rep(i,n) for(int i=0;i<n;i++)
double EPS = 1e-10;
double add(double a,double b){
    if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;
}


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

    P operator +(P p){return P(x+p.x , y+p.y);}
    P operator -(P p){return P(x-p.x , y-p.y);}
    P operator *(double d){return P(x*d,y*d);}
    double dot(P p){return (x*(p.x) + y*(p.y));}
    double det(P p){return (x*p.y -y*p.x);}
    P turn(double theta){return P(x*cos(theta),y*sin(theta));}
    void output(){printf("(x,y)=%f %f\n",x,y);return ;}
};

bool on_seg(P p1,P p2, P q){
    return (fabs((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));
}

using namespace std;
int main()
{
    P p1,p2,p3,p4;
    char t;
    while(cin >> p1.x>>t>>p1.y>>t>>p2.x>>t>>p2.y>>t>>p3.x>>t>>p3.y>>t>>p4.x>>t>>p4.y)
    {
        //p1.output();p2.output();p3.output();p4.output();
        P koten = intersection(p1,p3,p2,p4);
        //P koten(0.5,0.5);
        //koten.output();
        if(on_seg(p1,p3,koten)){cout << "YES"<<endl;}
        else{cout << "NO"<<endl;}


    }
    return 0;
}

C++: #include<cstdio>
main(){double a,A,b,B,c,C,d,D,e;for(;~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&A,&b,&B,&c,&C,&d,&D);a-=b,b-=c,c-=d,d-=e,e=A,A-=B,B-=C,C-=D,D-=e,puts(a*B-A*b>0&&b*C-B*c>0&&c*D-C*d>0&&d*A-D*a>0?"YES":"NO"))e=a;}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

double distance(double x0, double y0, double x1, double y1)
{
	double x = x1 - x0;
	double y = y1 - y0;

	return sqrt(x * x + y * y);
}

double angle(double b, double c, double a)
{
	return acos((b * b + c * c - a * a) / (2 * b * c)) * (180 / M_PI);
}

int main()
{
	string s;
	for (; getline(cin, s);)
	{
		stringstream ss;
		ss << s;

		vector<double> x(4);
		vector<double> y(4);

		for (int i = 0; i < 4; i++)
		{
			ss >> x.at(i);
			ss.ignore();

			ss >> y.at(i);
			ss.ignore();
		}

		double a = distance(x.at(0), y.at(0), x.at(1), y.at(1));
		double b = distance(x.at(1), y.at(1), x.at(2), y.at(2));
		double c = distance(x.at(2), y.at(2), x.at(3), y.at(3));
		double d = distance(x.at(3), y.at(3), x.at(0), y.at(0));

		double e0 = distance(x.at(0), y.at(0), x.at(2), y.at(2));
		double e1 = distance(x.at(1), y.at(1), x.at(3), y.at(3));

		if ((e0 <= a && e0 <= b) || (e0 <= c && e0 <= d) || (e1 <= a && e1 <= d) || (e1 <= b && e1 <= c))
		{
			cout << "NO" << endl;
		}
		else
		{
			cout << "YES" << endl;
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>
#include <complex>

using namespace std;

#define REP(i,a,b) for((i)=(a);(i)<(int)(b);(i)++)
#define rep(i,n) REP(i,0,n)
// BEGIN CUT HERE
#define foreach(itr,c) for(typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
// END CUT HERE
typedef complex<double> P;

double crossP(P a, P b){return a.real()*b.imag() - a.imag()*b.real();}

int main(){
  int i,j,k,n;
  double xa,ya,xb,yb,xc,yc,xd,yd;
  P ab,bc,cd,da;

  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF){
    bool f = false;
    ab = P((xb-xa),(yb-ya));
    bc = P((xc-xb),(yc-yb));
    cd = P((xd-xc),(yd-yc));
    da = P((xa-xd),(ya-yd));

    if(crossP(ab,bc) > 0 && crossP(bc,cd) > 0 && crossP(cd,da) > 0 && crossP(da,ab) > 0) f = true;
    if(crossP(ab,bc) < 0 && crossP(bc,cd) < 0 && crossP(cd,da) < 0 && crossP(da,ab) < 0) f = true;

    if(f) printf("YES\n");
    else printf("NO\n");
  }

  return 0;
}

C++: #include<iostream>
#include<vector>
#include<cmath>
using namespace std;
struct Point { long double px, py; };
Point Minus(Point p1, Point p2) {
	Point p3;
	p3.px = p1.px - p2.px;
	p3.py = p1.py - p2.py;
	return p3;
}
long double norm(const Point& a) { return a.px * a.px + a.py * a.py; }
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
int ccw(Point p0, Point p1, Point p2) {
	Point a = Minus(p1, p0), b = Minus(p2, p0);
	if (crs(a, b) > 1e-10) return 1;
	if (crs(a, b) < -1e-10) return -1;
	if (dot(a, b) < -1e-10) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
bool is_convex(vector<Point> v) {
	if (v.size() < 3) return false;
	int s = -3;
	for (int i = 0; i < v.size(); i++) {
		int r = ccw(v[i], v[(i + v.size() - 1) % v.size()], v[(i + 1) % v.size()]);
		if (abs(r) == 1 && s == -3) s = r;
		if (s * r == -1) return false;
	}
	return true;
}
int main() {
	vector<Point>V; Point C;
	while (cin >> C.px >> C.py) {
		V.push_back(C);
		for (int i = 0; i < 3; i++) {
			cin >> C.px >> C.py;
			V.push_back(C);
		}
		bool G = is_convex(V);
		if (G == true)cout << "YES" << endl;
		if (G == false)cout << "NO" << endl;
	}
	return 0;
}