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 <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);
		cout << t << endl;
		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 <algorithm>
#include <vector>
#include <string>
#define int long long
using namespace std;
signed main() {
	string s;
	while (cin >> s) {
		s += ',';
		double d[10]; int p = 0;
		double d1 = 0, l = 1; bool b = 0;
		for (int i = 0; i < s.size(); i++) {
			if (s[i] == ',') {
				d[p] = d1; p++; d1 = 0;
				b = 0; l = 1;
			}
			else if (s[i] == '.') {
				b = 1; l = 0.1;
			}
			else if (!b) { d1 = d1 * 10 + (s[i] - '0'); }
			else { d1 += (s[i] - '0')*l; l /= 10; }
		}
		if (d[4] == d[0]) {
			if ((d[2] - d[0])*(d[0] - d[6]) <= 0) cout << "NO\n";
			else {
				double k = (d[7] - d[3]) / (d[6] / d[2]), p = d[3] - d[2] * k;
				if ((k*d[0] + p - d[1])*(d[5] - (k*d[4] + p)) <= 0)cout << "NO\n";
				else cout << "YES\n";
			}
		}
		else if (d[6] == d[2]) {
			if ((d[0] - d[2])*(d[2] - d[4]) <= 0) cout << "NO\n";
			else {
				double k1 = (d[5] - d[1]) / (d[4] - d[0]), p1 = d[1] - d[0] * k1;
				if ((k1*d[2] + p1 - d[3])*(d[7] - (k1 * d[6] + p1)) <= 0)cout << "NO\n";
				else cout << "YES\n";
			}
		}
		else {
			//01 45 - 23 67
			double k1 = (d[5] - d[1]) / (d[4] - d[0]), k2 = (d[7] - d[3]) / (d[6] / d[2]);
			double p1 = d[1] - d[0] * k1, p2 = d[3] - d[2] * k2;
			if      ((k1*d[2]+p1 - d[3])*(d[7] - (k1*d[6]+p1)) <= 0)cout << "NO\n";
			else if ((k2*d[0]+p2 - d[1])*(d[5] - (k2*d[4]+p2)) <= 0)cout << "NO\n";
			else cout << "YES\n";
		}
	}
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>

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;
}

//二次元ベクトル構造体
struct P {
	double x, y;

	P() {}
	P(double x, double y) : x(x), y(y) {
	}
	P operator + (P p) {
		return P(add(x, p.x), add(y, p.y));
	}
	P operator - (P p) {
		return P(add(x, -p.x), add(y, -p.y));
	}
	P operator * (double d) {
		return P(x * d, y * d);
	}
	double dot(P p) {	//　内積
		return add(x * p.x, y * p.y);
	}
	double det(P p) {	//　外積
		return add(x * p.y, -y * p.x);
	}
};

//　線分p1-p2上に点qがあるか判定
bool on_seg(P p1, P p2, P q) {
		return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0;
}

//　直線p1-p2と直線q1-q2の交点
P intersection(P p1, P p2, P q1, P q2) {
	return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}


int main() {

	P a, b, c, d;
	char dummy;

	while ( cin >> a.x >> dummy >> a.y >> dummy >> b.x >> dummy >> dummy >> b.y >> dummy >> c.x >> dummy >> c.y >> dummy >> d.x >> dummy >> d.y ) {

		if( (a - b).det(b - c) <= 0 || (b - c).det(c - d) <= 0 || (c - d).det(d - a) <= 0 ) {
			cout << "NO" << endl;
		} else {
			cout << "YES" << endl;
 		}
	}
}

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

using namespace std;

typedef struct{
    float x,y;
} P;

bool judge(P p1,P p2,P p3,P px){
    float s,a,b,c;
    s=0.5*abs((p1.x-p3.x)*(p2.y-p3.y)-(p2.x-p3.x)*(p1.y-p3.y));
    a=0.5*abs((p1.x-px.x)*(p2.y-px.y)-(p2.x-px.x)*(p1.y-px.y));
    b=0.5*abs((p2.x-px.x)*(p3.y-px.y)-(p3.x-px.x)*(p2.y-px.y));
    c=0.5*abs((p3.x-px.x)*(p1.y-px.y)-(p1.x-px.x)*(p3.y-px.y));
    float s_tmp=a+b+c;
    cout<<s<<endl;
    cout<<s_tmp<<endl;
    cout<<endl;
    
    if(s==a+b+c||(s+0.00001<=a+b+c&&s-0.00001>=a+b+c)){
        return true;
    }
    return false;
}

int main(void){
    P p[4];
    int i;
    bool flag;
    
    while(true){
        flag=true;
        for(i=0;i<4;i++){
            if(scanf("%f,%f,",&p[i].x,&p[i].y)==EOF)return 0;
        }
        if(judge(p[0],p[1],p[2],p[3])==false){
            if(judge(p[1],p[2],p[3],p[0])==false){
                if(judge(p[2],p[3],p[0],p[1])==false){
                    if(judge(p[3],p[0],p[1],p[2])==false){
                        cout<<"YES"<<endl;
                        flag=false;
                    }
                }
            }
        }
        if(flag){
            cout<<"NO"<<endl;
        }
    }
}

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;
	}
}