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 <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.ic", "r", stdin);
	string str = "";

	while (getline (cin, str ) ){
		if (str.empty() ){
			break;
		} // end if
		vector <double> x (4, 0. );
		vector <double> y (4, 0. );
		vector <double> vx (4, 0. );
		vector <double> vy (4, 0. );

		while (str.find(',') != string::npos ){
			str = str.replace(str.find(','), 1, " ");
		} // end while
		stringstream ss(str);
		int i;

		for (i = 0; i < 4; ++i){
			ss >> x[i] >> y[i];
		} // end for
		
		for (i = 0; i < 4; ++i){
			vx[i] = x[(i+1) % 4] - x[i];
			vy[i] = y[(i+1) % 4] - y[i];
//			cout << "v[" << i << "]: " << '(' << vx[i] << ',';
//			cout << vy[i] << ')' << endl;
		} // end for
		vector <double> exp (4, 0.);
		for (i = 0; i < 4; ++i){
//			double v2x = x[(i+2) % 4] - x[i];
//			double v2y = y[(i+2) % 4] - y[i];
			double v2x = vx[(i+1) % 4] + vx[i];
			double v2y = vy[(i+1) % 4] + vy[i];
			double v1x = vx[i];
			double v1y = vy[i];
//			cout << "v2" << '(' << v2x << ',' << v2y << ')' << endl;
//			cout << "v1" << '(' << v1x << ',' << v1y << ')' << endl;
			exp[i] = v1x*v2y - v1y*v2x;
//			cout << "inp[" << i << "]: " << inp[i] << endl;
			
//			inp[i] /= sqrt (v1x*v1x + v1y*v1y)*sqrt (v2x*v2x + v2y*v2y);
//			cout << "inp[" << i << "]: " << inp[i] << endl;
		} // end for

		for (i = 0; i < 4; ++i){
			if (exp[i] <= 0.){
				break;
			} // end if
		} // end for

		if (i == 4){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if

	} // end while
		
	return 0;
}

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

using namespace std;

double tri2s(double xa, double ya, double xb, double yb, double xc, double yc){
     double a, b, c, s;
    
     a = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc));
     b = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc));
     c = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
    
     s = (a+b+c) / 2;
    
     return sqrt(s * (s - a) * (s - b) * (s - c));
}

int main(void){
     double x[4], y[4];
     double sq;
     double tri[4];
     bool isok = true;
    
     while(cin >> x[0]){
          cin.ignore(); cin >> y[0];
          cin.ignore(); cin >> x[1]; cin.ignore(); cin >> y[1];
          cin.ignore(); cin >> x[2]; cin.ignore(); cin >> y[2];
          cin.ignore(); cin >> x[3]; cin.ignore(); cin >> y[3];
		  /*
          sq = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]) + tri2s(x[0],y[0],x[2],y[2],x[3],y[3]);
         
          tri[0] = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]);
          tri[1] = tri2s(x[0], y[0], x[1], y[1], x[3], y[3]);
          tri[2] = tri2s(x[0], y[0], x[2], y[2], x[3], y[3]);
          tri[3] = tri2s(x[1], y[1], x[2], y[3], x[3], y[3]);
         
          for(int i=0;i<4;i++){
               if(tri[i] > sq) isok = false;
          }
		  */
          if(tri2s(x[0],y[0],x[1],y[1],x[2],y[2]) + tri2s(x[0],y[0],x[2],y[2],x[3],y[3]) ==
			 tri2s(x[0],y[0],x[1],y[1],x[3],y[3]) + tri2s(x[2],y[2],x[1],y[1],x[3],y[3]) ){
               cout << "YES" << endl;
          }else{
               cout << "NO" << endl;
          }
          isok = true;
     }
     return 0;
}

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

double ab,ac,ad,bc,bd,cd;
bool heron();

int main(){
	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF){
		
		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));
		
		bool f = heron();
		(f) ? puts("YES") : puts("NO");
	}
	return 0;
}

bool heron(){
	double sq1=0.0,sq2=0.0;
	double S,s;
	
	/*sq1*/
	s = (ab+ac+bc)*0.5;
	S = sqrt(s * (s-ab) * (s-ac) * (s-bc));
	sq1 += S;
	s = (ac+ad+cd)*0.5;
	S = sqrt(s * (s-ac) * (s-ad) * (s-cd));
	sq1 += S;
	
	/*sq2*/
	s = (ab+ad+bd)*0.5;
	S = sqrt(s * (s-ab) * (s-ad) * (s-bd));
	sq2 += S;
	s = (bc+bd+cd)*0.5;
	S = sqrt(s * (s-bc) * (s-bd) * (s-cd));
	sq2 += S;
	bool j;
	(fabs(sq1-sq2) <= 0.01) ? j = true : j = false;
	
	return j;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
struct P{
  double x,y;
  P(){}
  P(double x,double y):x(x),y(y){}
};
bool isIntersecter(P a,P b,P p,P q ){
  return ((a.x - b.x)*(p.y - a.y) - (a.y - b.y)*(p.x - a.x))*((a.x - b.x)*(q.y - a.y) - (a.y - b.y)*(q.x - a.x)) > 0;
}
int main(){
  P a[4];
  char c;
  while(cin >> a[0].x){
    cin >> c >> a[0].y; 
    for(int i = 1 ; i < 4 ; i++ ) {
      cin >> c >> a[i].x >> c >> a[i].y;  
    }
    if(isIntersecter(a[0],a[2],a[1],a[3]) ||
       isIntersecter(a[1],a[3],a[0],a[2])){
      cout << "NO" << endl;
    } else cout << "YES" << endl;

  }
}

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


using namespace std;

double area(double a, double b, double c)
{
	double s = (a+b+c)/2;
	return sqrt(s*(s-a)*(s-b)*(s-c));
}
double distance(double x1, double y1, double x2, double y2)
{
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
bool isInTriangle(double x[3], double y[3], double xp, double yp)
{
	double edge[3];
	for (int i = 0; i < 3; ++i)
		edge[i] = distance(x[i], y[i], x[(i+1)%3], y[(i+1)%3]);
	double correctArea = area(edge[0], edge[1], edge[2]);
	double totalArea = 0;
	for (int i = 0; i < 3; ++i)
	{
		totalArea += area(distance(x[i], y[i], xp, yp)
			, distance(x[(i+1)%3], y[(i+1)%3], xp, yp), edge[i]);
	}
	return abs(correctArea - totalArea) < 0.0001;
}

int main()
{
	double x[4], y[4];
	while (true)
	{
		for (int i = 0; i < 3; ++i)
			scanf("%lf,%lf,", x+i, y+i);
		if (scanf("%lf,%lf", x+3, y+3) == EOF)
			break;

		bool isConvace = false;
		for (int i = 0; i < 4; ++i)
		{
			double xp = x[i];
			double yp = y[i];
			double tx[3], ty[3];
			for (int j = 0; j < 3; ++j)
			{
				tx[j] = x[(i+j+1)%4];
				ty[j] = y[(i+j+1)%4];
			}
			isConvace |= isInTriangle(tx, ty, xp, yp);
		}
		if (isConvace)
			puts("NO");
		else
			puts("YES");
	}

	return 0;
}