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<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<iomanip>
using namespace std;
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

class Point{
	public:
		double x, y;

		Point(double x = 0, double y = 0): x(x), y(y) {}

		Point operator + (Point p){ return Point(x + p.x, y + p.y);}
		Point operator - (Point p){ return Point(x - p.x, y - p.y);}
		Point operator * (double a){ return Point(a * x, a * y);}
		Point operator / (double a){ return Point(x / a, y / a);}

		double abs(){ return sqrt(norm());}
		double norm(){ return x * x + y * y;}

		bool operator < (const Point &p) const{
			return x != p.x ? x < p.x : y < p.y;
		}

		bool operator == (const Point &p) const{
			return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
		}
};

typedef Point Vector;

double dot(Vector a, Vector b){
	return a.x * b.x + a.y * b.y;
}
double cross(Vector a, Vector b){
	return a.x * b.y - a.y * b.x;
}
int ccw(Point p0, Point p1, Point p2){
	Vector a = p1 - p0;
	Vector b = p2 - p0;
	if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
	if(cross(a, b) < -EPS) return CLOCKWISE;
	if(dot(a, b) < -EPS) return ONLINE_BACK;
	if(a.norm() < b.norm()) return ONLINE_FRONT;

	return ON_SEGMENT;
}
int main(){
	char line[100];
	while(fgets(line, sizeof(line), stdin) != NULL){
		Point p[6];
		sscanf(line, "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &p[0].x, &p[0].y, &p[1].x, &p[1].y, &p[2].x, &p[2].y, &p[3].x, &p[3].y);
		p[4] = p[0], p[5] = p[1];
		bool flag = true;
		for(int i = 1; i <= 4; i++){
			if(ccw(p[i - 1], p[i], p[i + 1]) != 1) flag = false;
		}
		if(flag) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

int main(){
	double x[4], y[4];
	double vx, vy, v1x, v1y, v2x, v2y;
	double s, t;
	bool convex;
	
	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])) != EOF){
		convex = true;
		for(int i = 0; i < 4; i++){
			vx = x[i] - x[(i + 1) % 4];
			vy = y[i] - y[(i + 1) % 4];
			v1x = x[(i + 2) % 4] - x[(i + 1) % 4];
			v1y = y[(i + 2) % 4] - y[(i + 1) % 4];
			v2x = x[(i + 3) % 4] - x[(i + 1) % 4];
			v2y = y[(i + 3) % 4] - y[(i + 1) % 4];
			
			s = (double)(vx*v2y - vy*v2x) / (v1x*v2y - v1y*v2x);
			t = (double)(vx*v1y - vy*v1x) / (v2x*v1y - v2y*v1x);
			if(0 <= s && s <= 1 && 0 <= t && t <= 1){
				convex = false;
				printf("NO\n");
				break;
			}
		}
		if(convex){
			printf("YES\n");
		}
	}
	
	return 0;
}

C++: #include<iostream>

using namespace std;

struct point{
	double x;
	double y;
};

struct line{
	double a; // 傾き
	double b; // y切片
};

istream& operator >> ( istream& s , point& p );
bool get_convex( const point& a , const point& b , const point& c , const point& d );

int main(void)
{
	point a, b, c, d;

	while(1)
	{
		cin >> a >> b >> c >> d;
		if( cin.eof() ) break;
		if( get_convex( a , b , c , d ) ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

istream& operator >> ( istream& s , point& p )
{
	return s >> p.x >> p.y;
}

bool get_convex( const point& a , const point& b , const point& c , const point& d )
{
	point a_c, a_b, a_d;
	point b_d, b_a, b_c;

	a_c.x = c.x-a.x; a_c.y = c.y-a.y;
	a_b.x = b.x-a.x; a_b.y = b.y-a.y;
	a_d.x = d.x-a.x; a_d.y = d.y-a.y;
	b_d.x = d.x-b.x; b_d.y = d.y-b.y;
	b_a.x = a.x-b.x; b_a.y = a.y-b.y;
	b_c.x = c.x-b.x; b_c.y = c.y-b.y;

	bool result_a, result_b;

	result_a = ( ( a_c.x * a_b.y - a_b.x * a_c.y ) * ( a_c.x * a_d.y - a_d.x * a_c.y ) < 0 );
	result_b = ( ( b_d.x * b_a.y - b_a.x * b_d.y ) * ( b_d.x * b_c.y - b_c.x * b_d.y ) < 0 );

	if( result_a == true && result_b == true ) return true;
	else return false;
}

C++: #include<string>
#include<vector>
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)
const double EPS=1e-6;

int main(){

	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd){

		double a1=ya-yc;
		double b1=xc-xa;
		double c1=ya*(xa-xc)-xa*(ya-yc);
		double a2=yb-yd;
		double b2=xd-xb;
		double c2=yb*(xb-xd)-xb*(yb-yd);

		if((a1*xb+b1*yb+c1)*(a1*xd+b1*yd+c1)<0 && (a2*xa+b2*ya+c2)*(a2*xc+b2*yc+c2)<0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <cmath>
#include <sstream>
#define F first
#define S second
#define FOR(i,n) for(int i=0;i<(int)n;i++)
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define FORI(i,k,n) for(int i=k;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
typedef pair<double, double> pdd;
bool deb(int x) {cout << x << ":ok" << endl; return true;}
bool deb() {cout << "ok" << endl; return true;}

double wid(pdd a, pdd b) {
	return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
}

double yoge(pdd a, pdd b, pdd c) {
	double A, B, C;
	A = wid(a, b); B = wid(b, c); C = wid(c, a);
	return acos((B*B+C*C-A*A)/(2*B*C));
}

int main() {
	pdd p[4];
	while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&p[0].first,&p[0].second,&p[1].first,&p[1].second,&p[2].first,&p[2].second,&p[3].first,&p[3].second)!=EOF) {
		bool ok = true;
		if(abs(yoge(p[0],p[1],p[2])/3.1415926535*180)>90)ok=false;
		if(abs(yoge(p[1],p[2],p[3])/3.1415926535*180)>90)ok=false;
		if(abs(yoge(p[2],p[3],p[0])/3.1415926535*180)>90)ok=false;
		if(abs(yoge(p[3],p[0],p[1])/3.1415926535*180)>90)ok=false;

		if(ok)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}

}