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<bits/stdc++.h>
using namespace std;
double d[10];
string s;
void f() {
	s += ',';
	bool b00l = 0;
	int cnt = 0;
	double p = 0, sig = 1, pk = 1;
	for (char ch : s) {
		if (ch == ',') {
			d[cnt] = p * sig;
			p = 0; sig = 1; cnt++;
			b00l = 0; pk = 1;
		}
		else if (ch == '-')sig = -1;
		else if (ch == '.') b00l = 1;
		else if (b00l) {
			pk /= 10;
			p += pk * (ch - '0');
		}
		else p = p * 10 + ch - '0';
	}
}
signed main() {
	while (cin >> s) {
		f();
		if (((d[0] - d[4]) * (d[3] - d[1]) - (d[1] - d[5]) * (d[2] - d[0])) * ((d[0] - d[4]) * (d[7] - d[1]) - (d[1] - d[5]) * (d[6] - d[0])) > 0)cout << "NO\n"; else
		if (((d[2] - d[6]) * (d[1] - d[3]) - (d[3] - d[7]) * (d[0] - d[2])) * ((d[2] - d[6]) * (d[5] - d[3]) - (d[3] - d[7]) * (d[4] - d[2])) > 0)cout << "NO\n";
		else cout << "YES\n";//0145<=>2367
	}
}

C++: #include <iostream>

using namespace std;

bool check(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
	double res1 = (y2-y1)*(x3-x1)/(x2-x1)-(y3-y1), res2 = (y2-y1)*(x4-x1)/(x2-x1)-(y4-y1);
	if (res1 > 0 && res2 > 0) return false;
	if (res1 < 0 && res2 < 0) return false;
	if (res1 == 0 || res2 == 0) return false;
	return true;

}
int main() {
	double a,b,c,d,e,f,g,h;
	while (scanf("%f,%f,%f,%f,%f,%f,%f,%f\n",a,b,c,d,e,f,g,h)!=EOF) {
		if (check(a,b,e,f,c,d,g,h) && check(c,d,g,h,a,b,e,f)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

//??´???AB????§?????????´???BC????§??????????RotType????¨????(A???B???C????????§??????)
//RotType = ????????¢1, ????????¢-1, ??´???0
int getRotType( double angle_a, double angle_b ){
	const int eps = 1e-8;
	const double PAI = 3.14159265358979;
	
	if( fabs(angle_a - angle_b) <= eps )
		return 0;
	if( angle_a > angle_b + PAI )
		angle_b += 2 * PAI;
	else if( angle_b > angle_a + PAI )
		angle_a += 2 * PAI;
	
	if( angle_b > angle_a )	//?§????????¢????????????????
		return 1;
	return -1;	//?§???????????°?????????????
}

int main()
{
	double x[4], y[4];
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]) != -1)
	{
		//A???B???C, B???C???D, C???D???A?????????????????¨???????????????????????????
		double ang[4];
		
		for( int i = 0; i < 4; i++ )
			ang[i] = atan2(y[(i+1)%4] - y[i%4], x[(i+1)%4] - x[i%4]);
		
		double angType[4];
		for( int i = 0; i < 4; i++ )
			angType[i] = getRotType( ang[i], ang[(i+1)%4] );
		
		int i;
		for( i = 0; i < 3; i++ ){
			if( angType[i] != angType[i+1] )
				break;
		}
		if( i == 3 )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

using namespace std;

double tri2s(double xa, double ya, double xb, double yb, double xc, double yc){
     double a, b, c, s;
    
     a = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc));
     b = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc));
     c = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
    
     s = (a+b+c) / 2;
    
     return sqrt(s * (s - a) * (s - b) * (s - c));
}

int main(void){
     double x[4], y[4];
     double sq;
     double tri[4];
     bool isok = true;
    
     while(cin >> x[0]){
          cin.ignore(); cin >> y[0];
          cin.ignore(); cin >> x[1]; cin.ignore(); cin >> y[1];
          cin.ignore(); cin >> x[2]; cin.ignore(); cin >> y[2];
          cin.ignore(); cin >> x[3]; cin.ignore(); cin >> y[3];
         
          sq = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]) + tri2s(x[0],y[0],x[2],y[2],x[3],y[3]);
         
          tri[0] = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]);
          tri[1] = tri2s(x[0], y[0], x[1], y[1], x[3], y[3]);
          tri[2] = tri2s(x[0], y[0], x[2], y[2], x[3], y[3]);
          tri[3] = tri2s(x[1], y[1], x[2], y[3], x[3], y[3]);
         
          for(int i=0;i<4;i++){
               if(tri[i] > sq) isok = false;
          }
         
          if(isok){
               cout << "YES" << endl;
          }else{
               cout << "NO" << endl;
          }
          isok = true;0
     }
     return 0;
}

C++: #include    <iostream>

using namespace std;

// A[x,y]、B[x,y]を通る直線とC[x,y]、D[x,y]を結ぶ線分の交差判定を返す。
// 「((ax - bx)*(cy - ay)+(ay - by)*(ax - cx))*((ax - bx)*(dy - ay)+(ay - by)*(ax - dx))」
bool cross(double* a, double* b, double* c, double* d) {
    return ((a[0]-b[0])*(c[1]-a[1])+(a[1]-b[1])*(a[0]-c[0]))*((a[0]-b[0])*(d[1]-a[1])+(a[1]-b[1])*(a[0]-d[0])) > 0.0;
}

int main() {
    // 四角形ABCDの対角線ACとBDの線分が交差するか否かで判定可能である。
    // 線分同士を直接比較するのは難しいため、片方を直線とみなした上で、
    // 「直線と線分の交差判定」をする事で可能となる。
    
    double pos[4][2];
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
        &pos[0][0], &pos[0][1], &pos[1][0], &pos[1][1], &pos[2][0], &pos[2][1], &pos[3][0], &pos[3][1])) {
        
        cout << (cross(pos[0],pos[1],pos[2],pos[3]) && cross(pos[2],pos[3],pos[0],pos[1]) ? "YES" : "NO") << endl;
    }

    return 0;
}

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

using namespace std;

class Vector{
public:
	double x,y;

	Vector(){}
	Vector( double dx, double dy ){
		x = dx;
		y = dy;
	}
	Vector operator-( const Vector& hoge ){
		return Vector( x - hoge.x, y - hoge.y );
	}

	Vector operator-( const Vector& hoge ) const{
		return Vector( x - hoge.x, y - hoge.y );
	}
};

double crossConduct( const Vector& lhs, const Vector& rhs )
{
	return lhs.x * rhs.y - lhs.y * rhs.x;
}

double line( const Vector& a, const Vector& b, const Vector& p )
{
	Vector hoge = b - a;
	Vector piyo = p - a;

	return crossConduct( hoge, piyo );
}

int main(int argc, char const* argv[])
{
	Vector 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)){
		double a,b,c,d;
		a = line( A, B, C );
		b = line( B, C, D );
		c = line( C, D, A );
		d = line( D, A, B );
		if( ( a > 0 && b > 0 && c > 0 && d > 0 ) || ( a < 0 && b < 0 && c < 0 && d < 0 ) ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;


}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

struct Vector{
	double x;
	double y;
};

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

int main(){
	double xa,ya,xb,yb,xc,yc,xd,yd;
	char c;
	while(cin>>xa>>c>>ya>>c>>xb>>c>>yb>>c>>xc>>c>>yc>>c>>xd>>c>>yd){
		Vector ab , bc , ac , da , bd , dc;
		ab.x=xb-xa;
		ab.y=yb-ya;
		bc.x=xc-xb;
		bc.y=yc-yb;
		ac.x=xc-xa;
		ac.y=yc-ya;
		da.x=xa-xd;
		da.y=ya-yd;
		bd.x=xd-xb;
		bd.y=xd-xb;
		dc.x=xc-xd;
		dc.y=yc-yd;
		double abac , bdbc , dadc;
		abac=gaiseki(&ab , &ac);
		bdbc=gaiseki(&bd , &bc);
		dadc=gaiseki(&da , &dc);
		if((abac<0 && bdbc<0 && dadc<0)||(abac>=0 && bdbc>=0 && dadc>=0 )) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0; 
}