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<stdio.h>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	double xa, ya, xb, yb, xc, yc, xd, yd,s1,s2,s3,s4;
	while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)) {
		s1=abs((xc - xa)*(yb - ya) - (xb - xa)*(yc - ya));
		s2 = abs((xc - xa)*(yd - ya) - (xd - xa)*(yc - ya));
		s3 = abs((xb - xa)*(yd - ya) - (xd - xa)*(yb - ya));
		s4 = abs((xb - xc)*(yd - yc) - (xd - xc)*(yb - yc));
		if (s1 + s2 == s3 + s4) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

double distance(double x0, double y0, double x1, double y1)
{
	double x = x1 - x0;
	double y = y1 - y0;

	return sqrt(x * x + y * y);
}

double angle(double b, double c, double a)
{
	return acos((b * b + c * c - a * a) / (2 * b * c)) * (180 / M_PI);
}

int main()
{
	string s;
	for (; getline(cin, s);)
	{
		stringstream ss;
		ss << s;

		vector<double> x(4);
		vector<double> y(4);

		for (int i = 0; i < 4; i++)
		{
			ss >> x.at(i);
			ss.ignore();

			ss >> y.at(i);
			ss.ignore();
		}

		double a = distance(x.at(0), y.at(0), x.at(1), y.at(1));
		double b = distance(x.at(1), y.at(1), x.at(2), y.at(2));
		double c = distance(x.at(2), y.at(2), x.at(3), y.at(3));
		double d = distance(x.at(3), y.at(3), x.at(0), y.at(0));


		int ang0 = (int)angle(a, b, distance(x.at(0), y.at(0), x.at(2), y.at(2)));
		int ang1 = (int)angle(b, c, distance(x.at(1), y.at(1), x.at(3), y.at(3)));
		int ang2 = (int)angle(c, d, distance(x.at(2), y.at(2), x.at(0), y.at(0)));
		int ang3 = (int)angle(d, a, distance(x.at(3), y.at(3), x.at(1), y.at(1)));

		if (ang0 + ang1 + ang2 + ang3 == 360)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

double distance(double x0, double y0, double x1, double y1)
{
	double x = x1 - x0;
	double y = y1 - y0;

	return sqrt(x * x + y * y);
}

double angle(double b, double c, double a)
{
	return acos((b * b + c * c - a * a) / (2 * b * c)) * (180 / M_PI);
}

int main()
{
	string s;
	for (; getline(cin, s);)
	{
		stringstream ss;
		ss << s;

		vector<double> x(4);
		vector<double> y(4);

		for (int i = 0; i < 4; i++)
		{
			ss >> x.at(i);
			ss.ignore();

			ss >> y.at(i);
			ss.ignore();
		}

		double a = distance(x.at(0), y.at(0), x.at(1), y.at(1));
		double b = distance(x.at(1), y.at(1), x.at(2), y.at(2));
		double c = distance(x.at(2), y.at(2), x.at(3), y.at(3));
		double d = distance(x.at(3), y.at(3), x.at(0), y.at(0));


		double ang0 = angle(a, b, distance(x.at(0), y.at(0), x.at(2), y.at(2)));
		double ang1 = angle(b, c, distance(x.at(1), y.at(1), x.at(3), y.at(3)));
		double ang2 = angle(c, d, distance(x.at(2), y.at(2), x.at(0), y.at(0)));
		double ang3 = angle(d, a, distance(x.at(3), y.at(3), x.at(1), y.at(1)));

		if (ang0 + ang1 + ang2 + ang3 < 360.0)
		{
			cout << "NO" << endl;
		}
		else
		{
			cout << "YES" << endl;
		}
	}
}

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

using namespace std;

double ab;   //module
double ac;
double ad;
double bc;
double bd;
double cd;

bool Solution()
{
    double sq1 = 0.0;
    double sq2 = 0.0;
    
    double S;
    double f;
    
    /*sq1*/
    f = (ab + ac + bc) * 0.5;   //judge formula
    S = sqrt(f * (f - ab) * (f - ac) * (f - bc));
    sq1 += S;
    
    f = (ac + ad + cd) * 0.5;
    S = sqrt(f * (f - ac) * (f - ad) * (f - cd));
    sq1 += S;
    
    /*sq2*/
    f = (ab + ad + bd) * 0.5;
    S = sqrt(f * (f - ab) * (f - ad) * (f - bd));
    sq2 += S;
    
    f = (bc + bd + cd) * 0.5;
    S = sqrt(f * (f - bc) * (f - bd) * (f - cd));
    sq2 += S;
    
    if (fabs(sq1 - sq2) <= 0.01)
    {
        return true;
    }
    else
    {
        return false;
    }

}

int main()
{
    double xa, ya;
    double xb, yb;
    double xc, yc;
    double xd, yd;
    
    char comma;
    
    while(cin>>xa>>comma>>ya>>comma>>xb>>comma>>yb>>comma>>xc>>comma>>yc>>comma>>xd>>comma>>yd)
    {
        
        ab = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
        ac = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc));
        ad = sqrt((xa - xd) * (xa - xd) + (ya - yd) * (ya - yd));
        bc = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc));
        bd = sqrt((xb - xd) * (xb - xd) + (yb - yd) * (yb - yd));
        cd = sqrt((xc - xd) * (xc - xd) + (yc - yd) * (yc - yd));
        
        if (Solution())
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }

    return 0;
}

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

using namespace std;
typedef complex<double> P;

double cr(P a,P b){return (conj(a)*b).imag();}

int main(){
  P a,b,c,d;
  char com;
  while(cin >> a.real() >> com >> a.imag() >> com >> b.real() >> com >> b.imag() >> com >> c.real() >> com >> c.imag() >> com >> d.real() >> com >> d.imag()){
    P e=a-b,f=b-c,g=c-d,h=d-a;
    double i=cr(e,f),j=cr(f,g),k=cr(g,h),l=cr(h,e);
    if((i>0&&j>0&&k>0&&l>0)||(i<0&&j<0&&k<0&&l<0))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

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

int main(){
	double a,b,c,d,e,f,g,h,AB,BC,CD,DA,abc,bcd,cda,dab;
	while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h) != EOF ){
		AB=sqrt((a-c)*(a-c)+(b-d)*(b-d));
		BC=sqrt((c-e)*(c-e)+(d-f)*(d-f));
		CD=sqrt((e-g)*(e-g)+(f-h)*(f-h));
		DA=sqrt((g-a)*(g-a)+(h-b)*(h-b));
		abc=((a-c)*(c-e)+(b-d)*(d-f))/AB/BC;
		bcd=((c-e)*(e-g)+(d-f)*(f-h))/BC/CD;
		cda=((e-g)*(g-a)+(f-h)*(h-b))/CD/DA;
		dab=((g-a)*(a-c)+(h-b)*(b-b))/DA/AB;
		a=acos(abc)+acos(bcd)+acos(cda)+acos(dab);
		if(a==2*M_PI){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <stdio.h>

#define EPS 1e-8

int main(void){
	double x1, y1, x2, y2, x3, y3, x4, y4;
	double cp1, cp2, cp3, cp4; // cross product for each angle
	int conv;
	
	while (scanf("%lf,", &x1)!=EOF){
		scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf", &y1, &x2, &y2, &x3, &y3, &x4, &y4);
		conv = 1;
		cp1 = (x2-x1)*(x1-x4) - (y2-y1)*(y1-y4);
		cp2 = (x3-x2)*(x2-x1) - (y3-y2)*(y2-y1);
		cp3 = (x4-x3)*(x3-x2) - (y4-y3)*(y3-y2);
		cp4 = (x1-x4)*(x4-x3) - (y1-y4)*(y4-y3);
		//printf("%f\t%f\t%f\t%f\n", cp1, cp2, cp3, cp4);
		
		if (cp1 * cp2 < -EPS) conv = 0;
		if (cp2 * cp3 < -EPS) conv = 0;
		if (cp3 * cp4 < -EPS) conv = 0;
		if (cp4 * cp1 < -EPS) conv = 0;
		puts(conv?"YES":"NO");
	}
	
	return 0;
}