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>
using namespace std;

int main(){
	double x[4],y[4];
	char c;
	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]){
		double a[4],b[4];
		for(int i=0;i<4;i++){
			a[i] = x[(i+1)%4]-x[i];
			b[i] = y[(i+1)%4]-y[i];
		}
		double c[4];
		for(int i=0;i<4;i++) c[i] = a[i]*b[(i+1)%4] - a[(i+1)%4]*b[i];
		int d = 0;
		for(int i=0;i<4;i++) if(c[i]>0.0) d++;
		if(d==4 or d==0) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
}

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

#define scanf scanf_s

double cross(complex<double> z1, complex<double> z2) {
	return z1.real() * z2.imag() - z1.imag() * z2.real();
}

int main() {
	double x1, y1, x2, y2, x3, y3, x4, y4;
	while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) != EOF) {
		complex<double> a(x1, y1), b(x2, y2), c(x3, y3), d(x4, y4);

		double ab, bc, cd, da;
		ab = cross(b - a, c - b);
		bc = cross(c - b, d - c);
		cd = cross(d - c, a - d);
		da = cross(a - d, b - a);

		if ((ab > 0 && bc > 0 && cd > 0 && da > 0) || (ab < 0 && bc < 0 && cd < 0 && da < 0)) {
			cout << "YES";
		}else {
			cout << "NO";
		}
		cout << endl;
	}
	return 0;
}

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

int main(){
	float xa, ya, xb, yb, xc, yc, xd, yd;
	
	while(scanf("%f,%f,%f,%f,%f,%f,%f,%f", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF){
		float x[4] = {xa,xb,xc,xd};
		float y[4] = {ya,yb,yc,yd};
		float s[4];
		bool allp = true, alln = true;
		
		
		for(int i = 0; i < 4; ++i){
			s[i] = (x[(i+1)%4] - x[i]) * (y[(i+2)%4] - y[(i+1)%4]) - (x[(i+2)%4] - x[(i+1)%4]) * (y[(i+1)%4] - y[i]);
		}
		
		for(int i = 0; i < 4; ++i){
			if(s[i] < 0){
				allp = false;
				break;
			}
		}
		for(int i = 0; i < 4; ++i){
			if(s[i] > 0){
				alln = false;
				break;
			}
		}
		
		if(allp || alln){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

typedef long long ll;
using namespace std;

struct Point{
	double x;
	double y;
};

bool is_inter(struct Point p1,struct Point p2,
	struct Point p3, struct Point 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;
	}

	return false;
}

int main()
{
	double xa, ya, xb, yb, xc, yc, xd, yd;
	Point a,b,c,d;
	while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",
		&xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd)){
			a.x = xa;
			a.y = ya;
			b.x = xb;
			b.y = yb;
			c.x = xc;
			c.y = yc;
			d.x = xd;
			d.y = yd;

			printf("%s\n",is_inter(a,c,b,d) && is_inter(b,d,a,c) ? "YES" : "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);
		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++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){
	
	float xa,ya,xb,yb,xc,yc,xd,yd;
	
	while(scanf("%f,%f,%f,%f,%f,%f,%f,%f",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF){
		float a,b,c,d;
		
		//if(xb!=xa)
		a=(yb-ya)/(xb-xa);
		//if(xc!=xd)
		b=(yc-yd)/(xc-xd);
		//if(xc!=xb)
		c=(yc-yb)/(xc-xb);
		//if(xd!=xa)
		d=(yd-ya)/(xd-xa);
		
	
		if(a==b&&c==d)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}

C++: #include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
// ------ Classes ------ //
class Point {
public:
	long double px, py;
	Point(long double px_, long double py_) : px(px_), py(py_) {};
	friend bool operator==(const Point& p1, const Point& p2) { return p1.px == p2.px && p1.py == p2.py; }
	friend bool operator!=(const Point& p1, const Point& p2) { return p1.px != p2.px || p1.py != p2.py; }
	friend Point operator+(const Point& p1, const Point& p2) { return Point(p1.px + p2.px, p1.py + p2.py); }
	friend Point operator-(const Point& p1, const Point& p2) { return Point(p1.px - p2.px, p1.py - p2.py); }
	friend Point operator*(const Point& p1, long double d) { return Point(p1.px * d, p1.py + d); }
	friend Point operator*(long double d, const Point& p1) { return p1 * d; }
	friend Point operator/(const Point& p1, long double d) { return Point(p1.px / d, p1.py / d); }
	Point& operator+=(const Point& p1) { px += p1.px; py += p1.py; return *this; }
	Point& operator-=(const Point& p1) { px -= p1.px; py -= p1.py; return *this; }
	Point& operator*=(long double d) { px *= d; py *= d; return *this; }
	Point& operator/=(long double d) { px /= d; py /= d; return *this; }
};
class Segment {
public:
	Point p1, p2;
	Segment(Point p1_, Point p2_) : p1(p1_), p2(p2_) {};
	Segment(long double p1x, long double p1y, long double p2x, long double p2y) : p1(Point(p1x, p1y)), p2(Point(p2x, p2y)) {};
	friend bool operator==(const Segment& s1, const Segment& s2) { return (s1.p1 == s2.p1 && s1.p2 == s2.p2) || (s1.p1 == s2.p2 && s1.p2 == s2.p1); }
	friend bool operator!=(const Segment& s1, const Segment& s2) { return !(s1 == s2); }
};
class Line {
public:
	Point p1, p2;
	Line(Point p1_, Point p2_) : p1(p1_), p2(p2_) {};
	Line(long double p1x, long double p1y, long double p2x, long double p2y) : p1(Point(p1x, p1y)), p2(Point(p2x, p2y)) {};
	friend bool operator==(const Line& s1, const Line& s2) { return (s1.p1 == s2.p1 && s1.p2 == s2.p2) || (s1.p1 == s2.p2 && s1.p2 == s2.p1); }
	friend bool operator!=(const Line& s1, const Line& s2) { return !(s1 == s2); }
};
// ------ Functions ------ //
long double norm(const Point& a) { return a.px * a.px + a.py * a.py; }
long double abs(const Point& a) { return sqrtl(norm(a)); }
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
int ccw(Point p0, Point p1, Point p2) {
	Point a = p1 - p0, b = p2 - p0;
	if (crs(a, b) > 1e-10) return 1;
	if (crs(a, b) < -1e-10) return -1;
	if (dot(a, b) < -1e-10) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
// ------ Main ------ //
Point p1, p2, p3, p4; int r1, r2, r3, r4;
int main() {
	while (~scanf("%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf", p1.px, p1.py, p2.px, p2.py, p3.px, p3.py, p4.px, p4.py)) {
		r1 = ccw(p1, p2, p3);
		r2 = ccw(p2, p3, p4);
		r3 = ccw(p3, p4, p1);
		r4 = ccw(p4, p1, p2);
		printf("%s\n", (r1 == r2 && r2 == r3 && r3 == r4 && abs(r1) == 1) ? "YES" : "NO");
	}
	return 0;
}