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<cstdio>
#include<cmath>

double spase(double a,double b,double c){
	return sqrt((a+b+c)*(b-a+c)*(a-b+c)*(a+b-c));
}

int main(){
	double a,b,c,d,e,f,g,h,AB,BC,CD,DA,AC,BD,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));
		AC=sqrt((a-e)*(a-e)+(b-f)*(b-f));
		BD=sqrt((c-g)*(c-g)+(d-h)*(d-h));
		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;
		abc=acos(abc)+acos(bcd)+acos(cda)+acos(dab);
		if((abc==2*M_PI)&&((float)(spase(AB,BC,AC)+spase(CD,DA,AC)-spase(DA,AB,BD)-spase(CD,BC,BD))==0)){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
	return 0;
}

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

#define PI 3.14159265358979

using namespace std;

double f(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4)
{
	return ((x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

int main()
{
	int x[4],y[4];

	while(scanf("%f,%f,%f,%f,%f,%f,%f,%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3])!=EOF)
	{
		if(f(x[0],y[0],x[2],y[2],x[1],y[1],x[3],y[3])>0 || f(x[1],y[1],x[3],y[3],x[0],y[0],x[2],y[2])>0)cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0;
}

C++: #include <cstdio>
using namespace std;
struct Point { double x, y; };

bool intersect(Point a, Point b, Point c, Point d) {
  return ((a.x - b.x) * (c.y - a.y) + (a.y - b.y) * (a.x - c.x)) * ((a.x - b.x) * (d.y - a.y) + (a.y - b.y) * (a.x - d.x)) < 0;
}

int main() {
  Point A, B, C, D;
  while (~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &A.x, &A.y, &B.x, &B.y, &C.x, &C.y, &D.x, &D.y)) {
    if (intersect(A, C, B, D) && intersect(B, D, A, C)) puts("YES");
    else puts("NO");
  }
}

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

using namespace std;

int main(void)
{
    double x1,x2,x3,x4;
    double y1,y2,y3,y4;
    int c1,c2,c3,c4;
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)) {
        c1 = (y2 - y1) / (x2 - x1);
        c2 = (y3 - y2) / (x3 - x2);
        c3 = (y3 - y4) / (x3 - x4);
        c4 = (y4 - y1) / (x4 - x1);
        if(c1==c3 && c2==c4) puts("YES");
        else puts("NO");
    }

    return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
bool C(double a,double b,double c,double d){return a*d-b*c>=0;}
main()
{
	double a,b,c,d,e,f,g,h;
	while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h))
	{
		int cnt=C(e-c,f-d,a-c,b-d)+C(g-e,h-f,c-e,d-f)+C(a-g,b-h,e-g,f-h)+C(c-a,d-b,g-a,h-b);
		cout<<(cnt==0||cnt==4?"YES":"NO")<<endl;
	}
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;

 const int maxn = 100000;
 struct Point
 {
    double x,y;
    Point() {}
    Point(double _x, double _y) {
        x = _x;
        y = _y;
    }

    Point operator -(const Point &B) const {
        return Point(x-B.x, y-B.y);
    }

 }p[maxn];

 double eps = 1e-10;
 
 int dcmp(double x)
 {
    if(fabs(x) < eps) return 0;
    else return x < 0 ? -1 : 1;
 }
 
 double Cross(Point A, Point B)
 {
    return A.x*B.y - A.y*B.x;
 }
 
 bool isConvex(Point *p, int n)
 {
    p[n] = p[0]; 
    p[n+1] = p[1]; 
    int now = dcmp(Cross(p[1]-p[0], p[2]-p[1]));
    for(int i = 1; i < n; i++)
    {
        int next = dcmp(Cross(p[i+1]-p[i], p[i+2]-p[i+1]));
        if(now*next < 0)
        {
            return false;
        }
        now = next; 
    }
    return true;
 }
 
 int main()
 {
    int n=4;
    char temp,temp2;
    while(cin>>p[0].x>>temp>>p[0].y>>temp2)
    {
        for(int i = 1; i < 3; i++)
        {
            char temp3,temp4;     
            cin>>p[i].x>>temp3>>p[i].y>>temp4;
        }
        char temp5;
        cin>>p[3].x>>temp5>>p[3].y;
        bool flag = isConvex(p,n);
        if(flag) printf("YES\n");
        else printf("NO\n");
    }
    //while(1);
    return 0;
 }

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cstring>
#include<complex>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

// vector(geometric) definition
typedef complex<double> cdouble;
// define with polor
const int N = 4;

int main()
{
    cdouble v[N + 2];
    double x[N], y[N];
    char t;
    while(cin>>x[0]>>t>>y[0]>>t >>x[1]>>t>>y[1]>>t >>x[2]>>t>>y[2]>>t
            >>x[3]>>t>>y[3])
    {
        REP(N) v[i] = cdouble(x[i], y[i]);
        v[N] = v[0];
        v[N + 1] = v[1];
        double ang[N + 2];
        //REP(6)cout << v[i] << endl;

        for(int i = 1; i <= 4; i++)
        {
            ang[i] = fmod( arg(v[i - 1] - v[i]) - arg(v[i + 1] - v[i]) + (10 * M_PI), M_PI * 2); 
            //cout << i << "th angle = " << ang[i] << endl;
        }
        int ans = 1;
        if(ang[1] > M_PI) {REP(4)if(ang[i + 1] < M_PI) ans = 0; }
        else {REP(4)if(ang[i + 1] > M_PI) ans = 0;}
        if(ans) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <complex>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef complex<double> p;
typedef pair<int, int> pii;
typedef long long ll;

double cross(p a, p b){
	
	return (a.real() * b.imag() - a.imag() * b.real());
}

string solve(vector<p> vc){

	bool sgo;
	
	for(int i=0; i<vc.size(); ++i){
		
		bool sg = cross(vc[i] - vc[(i+2)%vc.size()], vc[(i+1)%vc.size()] - vc[(i+2)%vc.size()]) > 0;
		
		if(i==0){
			sgo = sg;
			continue;
		}
		
		if(sgo ^ sg)
			return "NO";
	}
	
	return "YES";
}
	

int main(){

	double x[4], y[4];
	char c;
	vector<p> lct;
	
	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], !cin.eof()){
			
		for(int i=0; i<4; ++i){
			lct.push_back(p(x[i], y[i]));
		}
		
		cout << solve(lct) << endl;
	}
	
	return 0;
}