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>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>

using namespace std;

double EPS = 1e-12;

//誤差を考慮して足し算を行う
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 ccw(P a, P b, P c) {
	a = b - a;
	b = c - b;

	if(a.det(b) < 0) {
		return -1;
	} else if(a.det(b) > 0) {
		return 1;
	}

	return 0;
}


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 ) {
		int cnt, ans = 0, count = 0;

		cnt = ccw(a, b, c);
		ans += abs(cnt);
		count += cnt;
		cnt = ccw(b, c, d);
		ans += abs(cnt);
		count += cnt;
		cnt = ccw(c, d, a);
		ans += abs(cnt);
		count += cnt;
		cnt = ccw(d, a, b);
		ans += abs(cnt);
		count += cnt;

		if(abs(count) == ans) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

struct Point{
	double x,y;
	Point operator - (const Point a){
		x-=a.x;
		y-=a.y;
		return *this;
	}
};

typedef Point Vector;

double cross(Vector a,Vector b){
	return a.x*b.y-a.y*b.x;
}

Vector v[4];

double c[4];

int main(){
	while (1){
		if (scanf("%lf,%lf,",&v[0].x,&v[0].y)==EOF) break;
		FOR(i,1,4){
			scanf("%lf,%lf,",&v[i].x,&v[i].y);
		}
		bool flg=true;
		REP(i,4){
			c[i]=cross(v[(i+1)%4]-v[i],v[(i+2)%4]-v[i]);
		}
		REP(i,4){
			if (c[i]*c[(i+1)%4]<0) flg=false;
		}
		if (flg){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

vector<string> split_naive(const string &s, char delim) {
	vector<string> elems;
	string item;
	for(char ch:s){
		if(ch==delim){
			if(!item.empty()) elems.push_back(item);
			item.clear();
		}
		else{
			item += ch;
		}
	}
	if(!item.empty()) elems.push_back(item);
	return elems;
}

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	
	string S;
	while(cin>>S){
		auto SS = split_naive(S,',');
		double X[4],Y[4];
		for(int i=0;i<4;i++){
			sscanf(SS[2*i].c_str(),"%lf",&X[i]);
			sscanf(SS[2*i+1].c_str(),"%lf",&Y[i]);
		}

		array<double,4> outer;
		REP(i,4){
			double VX[2],VY[2],VN[2];
			VX[0] = X[(i+1)%4]-X[i];
			VY[0] = Y[(i+1)%4]-Y[i];
			VN[0] = hypot(VX[0],VY[0]);
			VX[0] /= VN[0];
			VY[0] /= VN[0];

			VX[1] = X[(i+2)%4]-X[(i+1)%4];
			VY[1] = Y[(i+2)%4]-Y[(i+1)%4];
			VN[1] = hypot(VX[1],VY[1]);
			VX[1] /= VN[1];
			VY[1] /= VN[1];

			outer[i] = VX[0]*VY[1]-VY[0]*VX[1];
		}
		if(all_of(ALL(outer),[](double c){return c>0;}) || all_of(ALL(outer),[](double c){return c<0;})){
			out("YES");
		}
		else out("NO");
	}
	return 0;
}

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

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 
int judge(double t1, double t2){
  int j=1;
  if(abs(t2-t1)>M_PI) j*=-1;
  if(t2-t1<0) j*=-1;
  return j;
}

int main(void){  
  double x[4],y[4],t[4];
  while(cin>>x[0]){
    int s = 0;
    cin.ignore();
    cin >> y[0];
    for(int i=1;i<4;i++){
      cin.ignore();
      cin >> x[i];
      cin.ignore();
      cin >> y[i];
    }
    REP(i,4)
      t[i] = atan2(y[(i+1)%4]-y[i], x[(i+1)%4]-x[i]);
    REP(i,4)
      s+=judge(t[i],t[(i+1)%4]);
    if(abs(s) == 4)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

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

using namespace std;
typedef struct point{
	double x,y;
} point;


double cross(point p1, point p2, point p3, point p4){  
    return ( (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));  
}

int main(){
	char a;
	double l[4];
	while(1){
	bool ans = true;
	point p[4]; 
		for(int i=0;i<4;i++)
	if(scanf("%lf,%lf,",&p[i].x,&p[i].y) == EOF) return 0;
	
    if(cross(p[0],p[2],p[1],p[3]) > 0.0 || cross(p[1],p[3],p[0],p[2] ) > 0.0) ans = false;
	
	
	if(ans == true) {cout << "YES" << endl;} else {cout << "NO" << endl; }
}


}

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

using namespace std;

typedef struct{
    double x,y;
} P;

bool judge(P p1,P p2,P p3,P px){
    double 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));
    cout<<s<<endl;
    cout<<a+b+c<<endl;
    
    if(s==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("%lf,%lf,",&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;
        }
    }
}