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 <bits/stdc++.h>
using namespace std;

using point = complex<double>;

constexpr double eps = 1e-8;

double dot(point a, point b) {
    return real(conj(a) * b);
}
double cross(point a, point b) {
    return imag(conj(a) * b);
}

int ccw(point a, point b, point c) {
    b -= a, c -= a;
    if(cross(b, c) > eps) return 1;
    if(cross(b, c) < -eps) return -1;
    if(dot(b, c) < 0) return 2;
    if(norm(b) < norm(c)) return -2;
    return 0;
}

bool isis_ss(point a1, point b1, point a2, point b2) {
    return ccw(a1, b1, a2) * ccw(a1, b1, b2) <= 0 && ccw(a2, b2, a1) * ccw(a2, b2, b1) <= 0;
}

int main() {
    string s;
    while(cin >> s) {
        for(auto& c : s) if(c == ',') c = ' ';
        stringstream ss(s);
        vector<point> ps;
        for(int i = 0; i < 4; ++i) {
            double x, y; ss >> x >> y;
            ps.emplace_back(x, y);
        }

        bool ok = true;
        for(int i = 0; i < 4; ++i) {
            ok &= isis_ss(ps[i], ps[(i + 2) % 4], ps[(i + 1) % 4], ps[(i + 3) % 4]);
        }
        
        cout << (ok ? "YES" : "NO") << endl;
    }
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  double x[4],y[4];
  double x1,y1,x2,y2,x3,y3;
  int i;
  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) {
	  for (i=0;i<4;i++) {
		  x1=x[(i+2) % 4]-x[i]; y1=y[(i+2) % 4]-y[i];
		  x2=x[(i+2) % 4]-x[(i+3) % 4]; y2=y[(i+2) % 4]-y[(i+3) % 4];
          x3=x[(i+2) % 4]-x[(i+1) % 4]; y3=y[(i+2) % 4]-y[(i+1) % 4];
		  if ((x1*x2+y1*y2+x1*x3+y1*y3)<=0) { i=10; break; }
	  }
	  if (i<10) cout << "YES" << endl; else cout << "NO" << endl;
  }
  return 0;
  }

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
const double EPS = 1e-8;
const double INF = 1e12;
#define PI 2*acos(0.0)
typedef complex<double> P;
namespace std { bool operator < (const P& a, const P& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } }
namespace std { bool operator == (const P& a, const P& b) { return abs(real(a) - real(b)) < EPS && abs(imag(a) - imag(b)) < EPS; } }
double cross(const P& a, const P& b) { return imag(conj(a)*b); }
double dot(const P& a, const P& b) { return real(conj(a)*b); }
struct L : public vector<P> { L() {} L(const P &a, const P &b) { push_back(a); push_back(b); } };
typedef vector<P> G;
struct C { P p; double r; C() {} C(const P &p, double r) : p(p), r(r) {} };
int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if (cross(b, c) > 0)   return +1;       // counter clockwise
	if (cross(b, c) < 0)   return -1;       // clockwise
	if (dot(b, c) < 0)     return +2;       // c--a--b on line
	if (norm(b) < norm(c)) return -2;       // a--b--c on line
	return 0;
}
/*---------------------------------------------------------------------------------------------------
????????????????????????????????? ??§?????§  
??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!
???????????? ??? ?´_???`??????/??? ???i     
?????????????????????????????? ???  |???|     
????????? /?????? /??£??£??£??£/??????|  
??? ???_(__??????/???    ???/ .| .|????????????  
??? ????????????/????????????/??????u??????  
---------------------------------------------------------------------------------------------------*/






//---------------------------------------------------------------------------------------------------
void _main() {
    double a, b, c, d, e, f, g, h;
    while (1 <= scanf("%f,%f,%f,%f,%f,%f,%f,%f", &a, &b, &c, &d, &e, &f, &g, &h)) {
        vector<P> v;
        v.push_back(P(a, b));
        v.push_back(P(c, d));
        v.push_back(P(e, f));
        v.push_back(P(g, h));

        set<int> s;
        rep(i, 0, 4) {
            int j = (i + 1) % 4;
            int k = (i + 2) % 4;

            s.insert(ccw(v[i], v[j], v[k]));
        }

        if (s.size() == 1) printf("YES\n");
        else printf("NO\n");
    }
}

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

using namespace std;
double x[4], y[4];
double ab, bc, cd, da, ac, bd;

double len(double x1, double y1, double x2, double y2)
{
    return sqrt(pow(x1-x2, 2) + pow(y1-y2, 2));
}

// Heron's Formula
double square(double a, double b, double c)
{
    double s = (a + b + c) / 2.0;
    return sqrt(s * (s-a) * (s-b) * (s-c));
}


int main(void)
{
    while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",x,y,x+1,y+1,x+2,y+2,x+3,y+3)) {
        ab = len(x[0],y[0],x[1],y[1]);
        bc = len(x[1],y[1],x[2],y[2]);
        cd = len(x[2],y[2],x[3],y[3]);
        da = len(x[3],y[3],x[1],y[1]);
        ac = len(x[0],y[0],x[2],y[2]);
        bd = len(x[3],y[3],x[1],y[1]);
        double s1,s2,s3,s4;
        s1 = square(ab, bd, da);
        s2 = square(cd, bd, bc);
        s3 = square(ac, cd, da);
        s4 = square(ab, bc, ac);
        double comp1;
        comp1 = (s1+s2) + (s3+s4);
        double mmax = max(max(s1,s2), max(s3,s4));

        if(fabs(mmax*2.0 - comp1) > 0.001)
            puts("YES");
        else
            puts("NO");
    }
    return 0;
}

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

double line(double x,double x1,double y1,double x2,double y2){
	return (y1-y2)/(x1-x2)*(x-x1)+y1;
}

int main(){
	double x1,x2,y1,y2,x3,y3,x4,y4;

	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)!=EOF){
		if((line(x2,x1,y1,x3,y3)-y2)*(line(x4,x1,y1,x3,y3)-y4)>0 || (line(x1,x2,y2,x4,y4)-y1)*(line(x3,x2,y2,x4,y4)-y3)>0){
			cout<<"NO"<<endl;
		}else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}

C++: #include<iostream>

using namespace std;

struct Point{double x,y;};
Point in[4];

bool solve(int num){

  int x = 0,y = 0;
  
  for(int i = 0; i < 4; i++) {
    if(i == num || abs(num-i) == 2) continue;
    if(in[num].x == in[i].x) x++;
    if(in[num].y == in[i].y) y++;
  }
  if(x != 1 || y != 1) return false;
  return true;
}
int main(){
  while(1){
    char c;

    for(int i = 0; i < 4; i++)
      if(i == 3) cin >> in[i].x >> c >> in[i].y;
      else if(!(cin >> in[i].x >> c >> in[i].y >> c)) return 0;


    bool ans = true;

    for(int i = 0; i < 4; i++) ans = (ans && solve(i));

    if(ans) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

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;
}