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<stdio.h>
int main(void){
   double x[5], y[5], key, keyy, keyx;
   int i, n = 4;
   while ( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x[1], &y[1], &x[2], &y[2], &x[3], &y[3], &x[4], &y[4]) != EOF ) {
      n = key = 4;
      while ( n ) {
         for ( i = 1; i < key; i++ ) {
            if ( y[i] > y[i + 1]) {
               keyy = y[i + 1];
               y[i + 1] = y[i];
               y[i] = keyy;
               keyx = x[i + 1];
               x[i + 1] = x[i];
               x[i] = keyx;
            }
            key--;
printf("a");
            n--;
         }
      }
printf("b");
      for ( i = 1; i <= 4; i++ ) {
         printf("x[%d]:%lf y[%d]:%lf\n", i, x[i], i, y[i]);
      }
   }
   return 0;
}

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

int main(void){
  double x[4], y[4];
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", x, y, x+1, y+1, x+2, y+2, x+3, y+3) != EOF){
    bool convex = false;
    for(int i = 0; i < 3; i++){
      double x1, y1, x2, y2;
      x1 = x[i+1] - x[i]; y1 = y[i+1] - y[i];
      x2 = x[(i+2)%4] - x[i+1]; y2 = y[(i+2)%4] - x[i+1];
      double a, b;
      a = sqrt(x1 * x1 + y1 * y1);
      b = sqrt(x2 * x2 + y2 * y2);
      double sin = (x1 * y2 - x2 * y1) / (a * b);
      if(sin < 0) { convex = true; break; }
    }
    if(convex) cout << "NO" << endl;
    else cout << "YES" << endl;
  }
  return 0;
}

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

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


inline double det(const P &a, const P &b) {
	return (conj(a) * b).imag();
}

int main() {
	double x[4], y[4];
	char c;
	for (; cin >> x[0] >> c >> y[0] ; ) {
		rep (i, 3) cin >> c >> x[i + 1] >> c >> y[i + 1];
		double a = 0, b = 0;
		double s = 0.0;
		rep (i, 4) s += fabs(det(P(x[i], y[i]), P(x[(i + 1) % 4], y[(i + 1) % 4]))) / 2.0;
		double sub_s = 0;
		rep(j, 4) {
			double ss = 0.0;
			rep(i, 4) if (i != j) {
				int idx = (i + 1) % 4;
				if(idx == j) idx = (i + 2) % 4;
				ss += fabs(det(P(x[i], y[i]), P(x[idx], y[idx]))) / 2.0;
			}
			sub_s = max(sub_s, ss);
		}
		cout << (s >= sub_s ? "YES" : "NO") << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <stack>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}

typedef pair<double, double> xy;

const double ERR = 1e-6;
double rnddouble(double d) {
    long l = 1 / ERR * 100;
    return (double)round(d * l) / l;
}

double area(xy A, xy B, xy C) {
    double ab = sqrt((A.first-B.first)*(A.first-B.first) + (A.second-B.second)*(A.second-B.second));
    double ac = sqrt((A.first-C.first)*(A.first-C.first) + (A.second-C.second)*(A.second-C.second));
    double bc = sqrt((B.first-C.first)*(B.first-C.first) + (B.second-C.second)*(B.second-C.second));
    double b = rnddouble((ab*ab+ac*ac-bc*bc)/2/ab/ac);
    double theta = acos(b);
    double a = 0.5 * ab * ac * sin(theta);
    return a;
}

int main() {
    float x1,y1,x2,y2,x3,y3,x4,y4;
    while(scanf("%f,%f,%f,%f,%f,%f,%f,%f", &x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) {
        xy A, B, C, D;
        A = make_pair(x1, y1);
        B = make_pair(x2, y2);
        C = make_pair(x3, y3);
        D = make_pair(x4, y4);
        if (abs(area(A,B,C) + area(A,C,D) - area(B,A,D) - area(B,C,D)) < ERR) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

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)&&on_seg(p2,p4,koten)){cout << "YES"<<endl;}
        else{cout << "NO"<<endl;}


    }
    return 0;
}

C++: #include<iostream>
#include<cstdlib>

using namespace std;

struct Point{double x,y;};
Point in[4];

bool solve(int num){

  int x = 0,y = 0;
  
  for(int i = 0; i < 4; i++) {
    if(i == num || abs(num-i) == 2) continue;
    if(in[num].x == in[i].x) x++;
    if(in[num].y == in[i].y) y++;
  }
  if(x != 1 || y != 1) return false;
  return true;
}
int main(){
  while(1){
    char c;

    for(int i = 0; i < 4; i++)
      if(i == 3) cin >> in[i].x >> c >> in[i].y;
      else if(!(cin >> in[i].x >> c >> in[i].y >> c)) return 0;


    bool ans = true;

    for(int i = 0; i < 4; i++) ans = (ans && solve(i));

    if(ans) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}