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++: /* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 

*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef double D;
typedef complex<D> P;

/* const */
const int INF = 999999999;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T> void print(T x) { std::cout << x << '\n'; }
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << '\n';
}

/* }}} */

bool intersect(P a, P b, P c, P d) {
  return ((a.X - b.X) * (c.Y - a.Y) + (a.Y - b.Y) * (a.X - c.X)) * 
    ((a.X - b.X) * (d.Y - a.Y) + (a.Y - b.Y) * (a.X - d.X)) > 0.0 && 
    ((c.X - d.X) * (a.Y - c.Y) + (c.Y - d.Y) * (c.X - a.X)) * 
    ((c.X - d.X) * (b.Y - c.Y) + (c.Y - d.Y) * (c.X - b.X)) > 0.0;
}

signed main()
{
  //cin.tie(0);
  //ios::sync_with_stdio(false);
  D a1, a2, b1, b2, c1, c2, d1, d2;

  while (~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &a1, &a2, &b1, &b2, &c1, &c2, &d1, &d2)) {
    P a = P(a1, a2), b = P(b1, b2), c = P(c1, c2), d = P(d1, d2);
    puts(intersect(a, b, c, d) ? "YES" : "NO");
  }

  return 0;
}

C++: #include <iostream>
 
using namespace std;
 
struct Vector {
        double x;
        double y;
};
 
bool is_c_inner(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) {
    Vector ab = Vector{xb - xa, yb - ya};
    Vector bc = Vector{xc - xb, yc - yb};
 
    Vector bd = Vector{xd - xb, yd - yb};
    Vector dc = Vector{xc - xd, yc - yd};
 
    Vector da = Vector{xa - xd, ya - yd};
    Vector ac = Vector{xc - xa, yc - ya};
 
    double cross_product_1 = ab.x * bc.y - ab.y * bc.x;
    double cross_product_2 = bd.x * dc.y - bd.y * dc.x;
    double cross_product_3 = da.x * ac.y - da.y * ac.x;
 
    return (cross_product_1 >=  0 && cross_product_2 >=  0 && cross_product_3 >=  0) ||
            (cross_product_1 <=  0 && cross_product_2 <=  0 && cross_product_3 <=  0);
}
 
int main() {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    string result;
    while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) == 8) {
        if(is_c_inner( xa, ya, xb, yb, xc, yc, xd, yd)
                || is_c_inner(xb, yb, xc, yc, xd, yd, xa, ya)
                || is_c_inner(xc, yc, xd, yd, xa, ya, xb, yb)
                || is_c_inner(xd, yd, xa, ya, xb, yb, xc, yc)
                ) {
            result = "NO"; // no convex
        } else {
            result = "YES"; //convex
        }
        cout << result << endl;
    }
    return 0;
}

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

struct P{
    P(double a, double b){
	x = a;y = b;
    }
    double x, y;
    double det(P a){
	return x * a.y - y * a.x;
    }
    P operator-(P a){
	return P(x - a.x, y - a.y);
    }
};

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)){
	P a = P(xa, ya);
	P b = P(xb, yb);
	P c = P(xc, yc);
	P d = P(xd, yd);
	P ab = b - a;
	P bc = c - b;
	P cd = d - c;
	P da = a - d;
	if((ab.det(bc) <= 0) == (bc.det(cd) <= 0) && (bc.det(cd) <= 0) == (cd.det(da) <= 0) && (cd.det(da) <= 0) == (da.det(ab) <= 0)){
	    cout << "YES" << endl;
	}
	else{
	    cout << "NO" << endl;
	}
    }
}

C++: #include <iostream>

using namespace std;

class Point{
public:
	double x;
	double y;
};


int isTriangleOutside(Point p1, Point p2, Point p3, Point p4){
	  double r1,r2,r3;
	  
   	  r1 = (p2.x-p1.x)*(p4.y-p1.y) - (p4.x-p1.x)*(p2.y-p1.y);
   	  r2 = (p3.x-p2.x)*(p4.y-p2.y) - (p4.x-p2.x)*(p3.y-p2.y);
   	  r3 = (p1.x-p3.x)*(p4.y-p3.y) - (p4.x-p3.x)*(p1.y-p3.y);
   
   	  if(r1>0&&r2>0&&r3>0 || r1<0&&r2<0&&r3<0){
   	      return 0;
   	  }else{
   	  	  return 1;
   	  }
}


int main(void){
   
   Point pa,pb,pc,pd;
   char c;
   int r1,r2,r3,r4;
   
   while(cin>>pa.x>>c>>pa.y>>c>>pb.x>>c>>pb.y>>c>>pc.x>>c>>pc.y>>c>>pd.x>>c>>pd.y){
   	
   	  r1 = 	isTriangleOutside(pa,pb,pc,pd);
   	  r2 = 	isTriangleOutside(pb,pc,pd,pa);
   	  r3 = 	isTriangleOutside(pc,pd,pa,pb);
   	  r4 = 	isTriangleOutside(pa,pb,pd,pc);
   	  
	  if(r1==1 && r2==1 && r3==1 &&r4==1){
   	      cout<<"YES"<<endl;
   	  }else{
   	  	  cout<<"NO"<<endl;
   	  }

   }
   
   return 0;
}