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>

using namespace std;

typedef struct{
  double x;
  double y;
}Point;


const int INF = (1<<25);
Point p[4];
double m[4];

void make(){
  for(int i = 0; i < 4; i++){
    if(p[i].x - p[(i+1)%4].x) m[i] = (p[i].y - p[(i+1)%4].y)/ (p[i].x - p[(i+1)%4].x);
    else m[i] = INF;
    //  cout << " "  << m[i] << endl;
  }
}

int solve(){
  make();
  if(m[0] == m[2] && m[1] == m[3]) return 1;
  return 0;
}

int main(){
  int status = 0;
  while(1){
    char t;
    for(int i = 0; i < 3; i++) if(!(cin >> p[i].x >> t >> p[i].y >> t)) status = 1;
    if(status) break;
    if(!(cin >> p[3].x >> t >> p[3].y)) status = 1;
    if(status) break;
    if(solve()) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

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

int main(){
	char trash;
	double x[4], y[4];
	while(cin >> x[0] >> trash >> y[0]){
		double a,b,c,d,e,f,t;
		for(int i = 1; i < 4; i++){
			cin >> trash >> x[i] >> trash >> y[i];
		}
		a = y[2]-y[0];
		b = -x[2]+x[0];
		e = -1*(y[0]*(x[2]-x[0])-x[0]*(y[2]-y[0]));
		c = y[3]-y[1];
		d = -x[3]+x[1];
		f = -1*(y[1]*(x[3]-x[1])-x[1]*(y[3]-y[1]));
		t = (e*d-b*f)/(a*d-b*c);
		if(x[2] < x[0]){
			swap(x[0],x[2]);
		}
		if(x[3] < x[1]){
			swap(x[1],x[3]);
		}
		if((t > x[0] && t < x[2]) && (t > x[1] && t < x[3])){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}

C++: #include <iostream>
#include <string>
#include <cmath>

using namespace std;

double sinvalue( double v1x, double v1y, double v2x, double v2y )
{

	return ( v1x*v2y - v1y * v2x ) / sqrt( v1x * v1x + v1y * v1y ) * sqrt( v2x * v2x + v2y * v2y );
}


int main()
{
	double ax, ay, bx, by, cx, cy, dx, dy;
	double vecx_ab, vecy_ab, vecx_bc, vecy_bc, vecx_cd, vecy_cd, vecx_da, vecy_da;
	double sindab, sinabc, sinbcd, sincda;
	char tmp;
	while ( cin >> ax >> tmp >> ay >> tmp >> bx >> tmp >> by >> tmp >> cx >> tmp >> cy >> tmp >> dx >> tmp >> dy )
	{
		vecx_ab = bx - ax; vecy_ab = by - ay;
		vecx_bc = cx - bx; vecy_bc = cy - by;
		vecx_cd = dx - cx; vecy_cd = dy - cy;
		vecx_da = ax - dx; vecy_da = ay - dy;

		sindab = sinvalue( vecx_ab, vecy_ab, -vecx_da, -vecy_da );
		sinabc = sinvalue( vecx_bc, vecy_bc, -vecx_ab, -vecy_ab );
		sinbcd = sinvalue( vecx_cd, vecy_cd, -vecx_bc, -vecy_bc );
		sincda = sinvalue( vecx_da, vecy_da, -vecx_cd, -vecy_cd );

		if ( sindab > 0 && sinabc > 0 && sinbcd > 0 && sincda > 0 )
		{
			cout << "YES" << endl;
		}
		else 
		{
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: #include<stdio.h>
int main(){
	double a[8];
	while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",a,a+1,a+2,a+3,a+4,a+5,a+6,a+7)){
		bool ok=true;
		if((a[0]-a[2])*(a[4]-a[2])+(a[1]-a[3])*(a[5]-a[3])<0)ok=false;
		if((a[2]-a[4])*(a[6]-a[4])+(a[3]-a[5])*(a[7]-a[5])<0)ok=false;
		if((a[4]-a[6])*(a[0]-a[6])+(a[5]-a[7])*(a[1]-a[7])<0)ok=false;
		if((a[6]-a[0])*(a[2]-a[0])+(a[7]-a[1])*(a[3]-a[1])<0)ok=false;
		printf(ok?"YES\n":"NO\n");
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e9 + 7;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second

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

char c;
double x[4], y[4];
Point p[4];

int main(){
	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]){
		REP(i, 4)p[i] = { x[i], y[i] };
		if (cross(p[0] - p[2], p[0] - p[1])*cross(p[0] - p[2], p[0] - p[3]) > 0){
			cout << "NO" << endl;
			continue;
		}
		if (cross(p[1] - p[3], p[1] - p[0])*cross(p[1] - p[3], p[1] - p[2]) > 0){
			cout << "NO" << endl;
			continue;
		}
		cout << "YES" << endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

double cross (double x1, double y1, double x2, double y2 )
{
	return (x1*y2 - x2*y1 );
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.convex", "r", stdin );
	string str = "";
	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if
		while (str.find(',') != string::npos ){
			str = str.replace(str.find(','), 1, " ");
		} // end while
		stringstream ss(str);
		vector<double> x(4, 0.0 ), y (4, 0.0 );
		rep (i, 4 ){
			ss >> x[i] >> y[i];
		} // end rep

		vector<double> res (4, 0 );
		rep (i, 4 ){
			res[i] = cross (	x[(i+2)%4] - x[i], y[(i+2)%4] - y[i],
								x[(i+1)%4] - x[i], y[(i+1)%4] - y[i] );
		} // end rep
		int pl = 0, ng = 0; 
		rep (i, 4 ){
			if (res[i] > 0. ) pl++;
			else
				ng++;
		} // end rep
		if (pl == 4 || ng == 4 ){
			printf ("YES\n" );
		}else{
			printf ("NO\n" );
		} // end if
	} // end loop

//	printf ("%d\n", res );
		
	return 0;
}

C++: #include <cstdio>

typedef struct
{
  double x, y;
} Point;

bool intersect(const Point& p1, const Point& p2, const Point& p3, const Point& p4)
{
  if (((p1.x-p2.x)*(p3.y-p1.y)+(p1.y-p2.y)*(p1.x-p3.x)) *
      ((p1.x-p2.x)*(p4.y-p1.y)+(p1.y-p2.y)*(p1.x-p4.x)) < 0)
    return true;
  return false;
}

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(intersect(a, c, b, d) && intersect(b, d, a, c))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}