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 <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;
			continue;
		}
		
		if(sgo ^ sg)
			return "NO";
	}
	
	return "YES";
}
	

int main(){
		
	while(!cin.eof()){
		
		vector<p> lct;
		
		for(int i=0; i<4; ++i){
		
			double x, y;
			char c;
			
			cin >> x >> c >> y;
			lct.push_back(p(x,y));
			
			if(i!=3)
				cin>>c;
		}
		
		cout << solve(lct) << endl;
	}
	
	return 0;
}

C++: //http://www5d.biglobe.ne.jp/~tomoya03/shtml/algorithm/Intersection.htm　参照
#include<cstdio>

using namespace std;

int main(void){
	float xa,ya,xb,yb,xc,yc,xd,yd;
	float ta,tb,tc,td;

	while((scanf("%f,%f,%f,%f,%f,%f,%f,%f",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd))!=EOF){
		ta=(xb-xd)*(ya-yb)+(yb-yd)*(xb-xa);
		tb=(xa-xc)*(yb-ya)+(ya-yc)*(xa-xb);
		tc=(xb-xd)*(yc-yb)+(yb-yd)*(xb-xc);
		td=(xa-xc)*(yd-ya)+(ya-yc)*(xa-xd);
		if(ta*tc<0 && tb*td<0)	printf("YES\n");
		else	printf("NO\n");
	}

	return 0;
}

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

double xa, ya, xb, yb, xc, yc, xd, yd;

double n1(double x, double y){
    return ((xb-xd)*(y-yb)-(yb-yd)*(x-xb));
}

double n2(double x, double y){
    return ((xa-xc)*(y-ya)-(ya-yc)*(x-xa));
}

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

C++: #include<iostream>
#include<vector>
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;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
char c;
double xa,ya,xb,yb,xc,yc,xd,yd,ab,bc,cd,da,aa,bb,cc,dd;
while(cin>>xa){
cin>>c>>ya>>c>>xb>>c>>yb>>c>>xc>>c>>yc>>c>>xd>>c>>yd;
ab=(xb-xa)*(yc-ya)-(yb-ya)*(xc-xa);
bc=(xc-xb)*(yd-yb)-(yc-yb)*(xd-xb);
cd=(xd-xc)*(ya-yc)-(yd-yc)*(xa-xc);
da=(xa-xd)*(yb-yd)-(ya-yd)*(xb-xd);
if(ab*bc<0||bc*cd<0||cd*da<0||da*ab<0)cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
return 0;
}

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

int main() {
  double xa, ya, xb, yb, xc, yc, xd, yd;
  double vx1, vy1, vx2, vy2;
  while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) == 8) {
    vx1 = ya-yc;
    vy1 = xc-xa;
    vx2 = yb-yd;
    vy2 = xd-xb;
    if ((vx1*(xb-xa)+vy1*(yb-ya))*(vx1*(xd-xa)+vy1*(yd-ya)) > 0 || (vx2*(xa-xb)+vy2*(ya-yb))*(vx2*(xc-xb)+vy2*(yc-yb)) > 0) printf("NO\n");
    else printf("YES\n");
  }

  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <complex>
#include <cstdio>
#define EPS 1e-10
#define EQ(a,b) (abs(a - b) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))
using namespace std;

typedef complex<double> P;

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

int is_intersected_ls(P a1, P a2, P b1, P b2) {
    return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
        ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}

int main ()
{
    double ax, ay, bx, by, cx, cy, dx, dy;
    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &ax, &ay, &bx, &by, &cx, &cy, &dx, &dy) != EOF) {
        P a = P(ax, ay);
        P b = P(bx, by);
        P c = P(cx, cy);
        P d = P(dx, dy);

        if (EQ(is_intersected_ls(a, c, d, b), 0.0)) cout << "NO" << endl;
        else cout << "YES" << endl;
    }

    return 0;
}

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

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 t) { return Point(x*t, y*t);}
};

typedef Point Vector;

double gaiseki(Vector a, Vector b) {
  return a.x*b.y - a.y*b.x;
}

double naiseki(Vector a, Vector b) {
  return a.x*b.x + a.y*b.y;
}

bool isHekomi(Point a, Point b, Point c, Point d) {
  double temp1;
  double temp2;
  int count = 0;
  for(int i = 0; i < 4; i++) {
    switch(i) {
    case 0:
      temp1 = gaiseki(d-a, c-a);
      temp2 = gaiseki(c-a, b-a);
      break;
    case 1:
      temp1 = gaiseki(a-b, d-b);
      temp2 = gaiseki(d-b, c-b);
      break;
    case 2:
      temp1 = gaiseki(b-c, a-c);
      temp2 = gaiseki(a-c, d-c);
      break;
    case 3:
      temp1 = gaiseki(c-d, b-d);
      temp2 = gaiseki(b-d, a-d);
      break;
    }
    if(temp1 >= 0 && temp2 >= 0 || temp1 <= 0 && temp2 <= 0) count++;
  }
  if(count == 4) return false;
  else           return true;
}

int main() {
  Point a, b, c, d;
  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) != EOF) {
    if(!isHekomi(a, b, c, d)) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}