Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <fstream>
#include <iterator>
#include <stdlib.h>
#include <map>
#include <queue>
#include <vector>
#include <functional>
#include <set>
#include <list>

using namespace std;

// vector cout
template<typename _Ty>
ostream& operator << (ostream& os, const vector<_Ty>& v) {
	os << "{";
	for (size_t i = 0; i < v.size(); i++)
	{
		if (i != 0) os << ", ";
		os << v[i];
	}
	os << "}";

	return os;
}

//point
class Point {
public:
	double x;
	double y;

	Point() {
		x = 0; y = 0;
	}
	Point(int x, int y) {
		this->x = x; this->y = y;
	}

	bool operator<(const Point& a) const {
		if (x == a.x)
			return y < a.y;
		else
			return x < a.x;
	}
};

//point cout
ostream& operator << (ostream& os, const Point& p) {
	return os << "(" << p.x << ", " << p.y << ")";
}


void rec(list<Point*>& Hull, list<Point*>& Points, Point* p1, Point* p2, int sgn) {

	double MaxDistance = 0;
	Point* pMaxDistance = NULL;
	list<Point*>::iterator it; //iterator

	//sgn?????????????????¨?????????
	list<Point*> sgnPoints;

	//sgn ????????????????????§??´??? p1-p2 ??????????????¢?????§??????????±???????
	for (it = Points.begin(); it != Points.end(); it++)  // list???????°??????§
	{
		Point* p = *it;
		double d = (p2->x - p1->x)*(p->y - p1->y) - (p2->y - p1->y)*(p->x - p1->x);

		//0 ????????´???????????£?????? sgn ??????????????¨
		double reg = sgn * d;

		//??´????????§????????°??????
		if (abs(reg) < 1e-8) {
			Points.erase(it);
			continue;
		}

		//??£?????????????????????????????¢?????????
		if (reg > 0) {
			sgnPoints.push_back(*it);

			if (abs(d) > MaxDistance) {
				MaxDistance = abs(d);
				pMaxDistance = p;
			}
		}
	}

	//?????¨??????????????°??????
	if (pMaxDistance == NULL) return;

	//p0 ??????????????????
	Point* p0 = pMaxDistance;
	Hull.push_back(p0);
	Points.remove(p0);
	sgnPoints.remove(p0);

	//????§???¢ p0, p1, p2 ?????¨????????¨??????????????????
	for (it = sgnPoints.begin(); it != sgnPoints.end(); it++) {
		Point* pl = *it;

		Point* p[3] = { p0, p1, p2 };
		//cross product
		double cp[3];
		for (int i = 0; i < 3; i++) {
			cp[i] = (p[(i + 1) % 3]->x - p[i]->x)*(pl->y - p[i]->y) - (p[(i + 1) % 3]->y - p[i]->y)*(pl->x - p[i]->x);
		}
		//?????¨???????????????
		if ((cp[0] < 0 && cp[1] < 0 && cp[2] < 0) || (cp[0] > 0 && cp[1] > 0 && cp[2] > 0)) {
			//??????
			Points.remove(*it);
		}
	}

	//??´??? (p0, p1) ???????????? p2 ????¬????
	double sp2 = (p1->x - p0->x)*(p2->y - p0->y) - (p1->y - p0->y)*(p2->x - p0->x);
	if (sp2 < 0) rec(Hull, Points, p0, p1, 1);
	else rec(Hull, Points, p0, p1, -1);

	//??´??? (p0, p2) ???????????? p1 ????¬????
	double sp1 = (p2->x - p0->x)*(p1->y - p0->y) - (p2->y - p0->y)*(p1->x - p0->x);
	if (sp1 < 0) rec(Hull, Points, p0, p2, 1);
	else rec(Hull, Points, p0, p2, -1);

	return;
}

int convexhull(vector<Point>& vPoints)
{
	//sort
	sort(vPoints.begin(), vPoints.end());

	//list ??? vPoints ??????????´???????????????????????´?
	list<Point*> lPoints;
	for (int i = 0; i < vPoints.size(); i++)
	{
		lPoints.push_back(&vPoints[i]);
	}

	//??????????§?????????????????????????
	list<Point*> Hull;

	//x??§?¨?????°????????????§?????????????????????
	Hull.push_back(lPoints.front());
	Hull.push_back(lPoints.back());

	//p1, p2
	Point* p1 = lPoints.front();
	Point* p2 = lPoints.back();

	//??????
	lPoints.pop_front();
	lPoints.pop_back();

	//?¬??????£???????????¢?´¢
	rec(Hull, lPoints, p1, p2, 1);
	//?¬??????????????????¢?´¢
	rec(Hull, lPoints, p1, p2, -1);

	return vPoints.size() - Hull.size();
}

int main() {

	while (1) {

		int n;
		vector<Point> Points;
		cin >> n;
		if (n == 0) break;
		for (int i = 0; i < n; i++) {
			Point p;
			string input;
			cin >> input;

			stringstream ss(input);

			ss >> p.x;
			ss.ignore();
			ss >> p.y;

			Points.push_back(p);
		}
		cout << convexhull(Points) << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int convexhull(std::vector<Point>&)':
a.cc:135:9: error: 'sort' was not declared in this scope; did you mean 'short'?
  135 |         sort(vPoints.begin(), vPoints.end());
      |         ^~~~
      |         short