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 <cmath>

using namespace std;

int main(void){

  double x[4];
  double y[4];
  char ten;

  while( cin >> x[0] >> ten >> y[0] ){

    cin >> ten >> x[1] >> ten >> y[1] >> ten >> x[2] >> ten >> y[2] >> ten >> x[3] >> ten >> y[3]; 

    double Area = 0;
    int I;
    for( int i = 0 ; i < 4 ; i++ ){//座標から多角形の面積を求める公式
      if( i == 3 ){
	I = 0;
      }
      else{
	I = i + 1;
      }
      Area += ( x[i] * y[I] ) - ( x[I] * y[i] );
    }

    Area = abs(Area) / 2;

    double area[4];
    area[0] = x[0]*y[1] - x[1]*y[0] + x[1]*y[2] - x[2]*y[1] + x[2]*y[0] - x[0]*y[2];
    area[1] = x[1]*y[2] - x[2]*y[1] + x[2]*y[3] - x[3]*y[2] + x[3]*y[1] - x[1]*y[3];
    area[2] = x[2]*y[3] - x[3]*y[2] + x[3]*y[0] - x[0]*y[3] + x[0]*y[2] - x[2]*y[0];
    area[3] = x[3]*y[0] - x[0]*y[3] + x[0]*y[1] - x[1]*y[0] + x[1]*y[3] - x[3]*y[1];

    for( int i = 0 ; i < 4 ; i++ ){
      area[i] = abs(area[i]) / 2; 
    }
   
   
    double AREA = area[0] + area[1] + area[2] + area[3];
    //cout << area[0] << "---" << area[1] << "---" << area[2] << "---" << area[3]<< endl;
    //cout << Area << endl;
    //cout << AREA << endl;
    if( AREA == 2*Area ) cout << "YES" << endl;
    else cout << "NO" << endl;

  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct P{
	double x;
	double y;
};

namespace std {
  bool operator < (const P& a, const P& b) {
    return a.x != b.x ? a.x < b.x : a.y < b.y;
  }
}

int ccw(P p0, P p1, P p2)
{
	double dx1 = p1.x-p0.x;
	double dy1 = p1.y-p0.y;
	double dx2 = p2.x-p0.x;
	double dy2 = p2.y-p0.y;
	
	if(dx1*dy2 > dy1*dx2){
		return 1;
	} 
	if(dx1*dy2 < dy1*dx2){
		return -1;
	}
	if((dx1*dx2 < 0) || (dy1*dy2 < 0)){
		return -1;
	}
	if((dx1*dx1+dy1*dy1)<(dx2*dx2+dy2*dy2)){
		return 1;
	}
	
	return 0;
}

int intersect(P p1, P p2, P p3, P p4)
{
	return (((ccw(p1, p2, p3)*ccw(p1, p2, p4)) <= 0)
				 &&((ccw(p3, p4, p1)*ccw(p3, p4, p2)) <= 0));
}


int convh(vector<P> vec)
{
	int n = vec.size(), k = 0;
	sort(vec.begin(), vec.end());
	vector<P> ch(2*n);
	
	for(int i = 0; i < n; ch[k++] = vec[i++]){
		while(k >= 2 && ccw(ch[k-2], ch[k-1], vec[i]) <= 0){
			k--;
		}
	}
	
	for(int i = n-2, t = k+1; i >= 0; ch[k++] = vec[i--]){
		while(k >= t && ccw(ch[k-2], ch[k-1], vec[i]) <= 0){
			k--;
		}
	}
	
	ch.resize(k-1);
	
	return ch.size();
}

int main()
{
	P pr[5];
	
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&pr[0].x,&pr[0].y,&pr[1].x,&pr[1].y,&pr[2].x,&pr[2].y,&pr[3].x,&pr[3].y)!=EOF){
		if(intersect(pr[0], pr[3], pr[1], pr[2]) == 1){
			cout << "NO" << endl;
			continue;
		}
		vector<P> vec;
		for(int i = 0; i < 4; i++){
			vec.push_back(pr[i]);
		}
		if(convh(vec) == 4){
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <stdio.h>

using namespace std;

bool check(double X1,double Y1,double X2,double Y2,double X3,double Y3,double X4,double Y4)
{
	return((X1 - X2) * (Y3 - Y1) - (Y1 - Y2) * (X3 - X1)) * ((X1 - X2) *(Y4 - Y1) - (Y1 - Y2) * (X4 - X1)) > 0.0;
}

void solve()
{
	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) )
	if(check(xa,ya,xc,yc,xb,yb,xd,yd) || check(xb,yb,xd,yd,xa,ya,xc,yc))
	{
		cout << "NO" << endl;
	}
	else
	{
		cout << "YES" << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
#include <complex>
using namespace std;

typedef complex<double> P;

#define x real()
#define y imag()

bool isIntersect(P p1,P p2,P p3,P 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;
	else
		return false;
}

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(xa,ya);
		P b(xb,yb);
		P c(xc,yc);
		P d(xd,yd);
		
		if(isIntersect(a,c,b,d)&&isIntersect(b,d,a,c))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
	

	
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
double EPS=1e-10;
double add(double a, double b)
{
	if(abs(a+b)<EPS*(abs(a)+abs(b))) return 0;
	return a+b;
}
double x[5],y[5];
bool input()
{
	bool suc=false;
	for(int i=0;i<4;i++) 
	{
		if(!i && scanf("%lf,%lf",&x[i],&y[i])!=EOF) suc=true;
		else if(i && scanf(",%lf,%lf",&x[i],&y[i])!=EOF) suc=true;
	}
	if(suc) return true;
	else return false;
}
int main()
{
	while(input())
	{
		bool failed=false; x[4]=x[0],y[4]=y[0];
		double vx[5],vy[5];
		for(int i=0;i<4;i++) vx[i]=x[i+1]-x[i],vy[i]=y[i+1]-y[i];
		vx[4]=vx[0],vy[4]=vy[0];
		bool plus=true;
		if(add(vx[0]*vy[1],-vy[0]*vx[1])<0) plus=false;
		for(int i=0;i<4;i++)
		{
			if(plus && add(vx[i]*vy[i+1],-vy[i]*vx[i+1])<0 ) failed=true;
			else if(!plus && add(vx[i]*vy[i+1],-vy[i]*vx[i+1])>0 ) failed=true;
		}
		if(failed) cout << "NO" << '\n' ;
		else cout << "YES" << '\n' ;
	}
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};

 


int main()
{
  double xa,xb,xc,xd,ya,yb,yc,yd;
  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF){
    double td =(xa-xc)*(yd-ya)+(ya-yc)*(xa-xd);
    double tb =(xa-xc)*(yb-ya)+(ya-yc)*(xa-xd);
    double ta =(xb-xd)*(xa-yb)+(yb-yd)*(xb-xa);
    double tc =(xb-xd)*(xc-yb)+(yb-yd)*(xb-xc);
    if(td*tb >0.0||ta*tc>0.0)
      cout <<"NO"<<endl;
    else
      cout <<"YES"<<endl;
  }
  return 0;
}