Language: C++

class Point {
    constructor(x, y) {
        this.x = x;
        this.y = y;
    };
};

function compare(p1, p2){
    var cross_prod = (p1.y * p0.y - p2.x * p1.x) - (p1.x * p0.x - p2.y * p1.y);

    if (cross_prod == 0) {
        return p1.y <= p2.y ? -1 : 1;
    }
    return cross_prod > 0 ? -1 : 1;
};


function swap(arr, min_idx) {
    var temp = arr[0];
    arr[0] = arr[min_idx];
    arr[min_idx] = temp;
    return arr;
}

function find_bot(arr, size) {
    //find min point
    var min = arr[0].y;
    var min_idx = 0;
    for ( var i = 0; i < size; i++) {
        if (arr[i].y < min || (arr[i].y == min && arr[i].x < arr[min_idx].x)) {
            min_idx = i;
            min = arr[i].y;
        };
    };
    //swap to 0
    swap(vec, min_idx);
    //return arr;
};

var file = require('fs').readFileSync('/dev/stdin', 'utf8');
var input = file.split("\n");
var size = input[0];
var points = []
for (var i = 1; i < size+1; i++) {
    point = input[i].split(" ");
    x = point[0];
    y = point[1];
    points.push(Point(x, y));
}
find_bot(points, size);
base_p = points[0];
sorted_arr = base_p.concat(points.subarray(1).sort(function (p1, p2) {
    var cross_prod = (p1.y * base_p.y - p2.x * p1.x) - (p1.x * base_p.x - p2.y * p1.y);
    if (cross_prod == 0) {
        return p1.y <= p2.y ? -1 : 1;
    }
    return cross_prod > 0 ? -1 : 1;
}));
console.log(points);





Compiler output:
a.cc:40:20: warning: multi-character character constant [-Wmultichar]
   40 | var file = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                    ^~~~
a.cc:40:39: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   40 | var file = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                       ^~~~~~~~~~~~
a.cc:40:53: warning: multi-character character constant [-Wmultichar]
   40 | var file = require('fs').readFileSync('/dev/stdin', 'utf8');
      |                                                     ^~~~~~
a.cc:2:17: error: 'x' has not been declared
    2 |     constructor(x, y) {
      |                 ^
a.cc:2:20: error: 'y' has not been declared
    2 |     constructor(x, y) {
      |                    ^
a.cc:2:5: error: ISO C++ forbids declaration of 'constructor' with no type [-fpermissive]
    2 |     constructor(x, y) {
      |     ^~~~~~~~~~~
a.cc: In member function 'int Point::constructor(int, int)':
a.cc:3:14: error: request for member 'x' in '(Point*)this', which is of pointer type 'Point*' (maybe you meant to use '->' ?)
    3 |         this.x = x;
      |              ^
a.cc:3:18: error: 'x' was not declared in this scope
    3 |         this.x = x;
      |                  ^
a.cc:4:14: error: request for member 'y' in '(Point*)this', which is of pointer type 'Point*' (maybe you meant to use '->' ?)
    4 |         this.y = y;
      |              ^
a.cc:4:18: error: 'y' was not declared in this scope
    4 |         this.y = y;
      |                  ^
a.cc:5:5: warning: no return statement in function returning non-void [-Wreturn-type]
    5 |     };
      |     ^
a.cc: At global scope:
a.cc:8:1: error: 'function' does not name a type; did you mean 'union'?
    8 | function compare(p1, p2){
      | ^~~~~~~~
      | union
a.cc:18:1: error: 'function' does not name a type; did you mean 'union'?
   18 | function swap(arr, min_idx) {
      | ^~~~~~~~
      | union
a.cc:25:1: error: 'function' does not name a type; did you mean 'union'?
   25 | function find_bot(arr, size) {
      | ^~~~~~~~
      | union
a.cc:40:1: error: 'var' does not name a type
   40 | var file = require('fs').readFileSync('/dev/stdin', 'utf8');
      | ^~~
a.cc:41:1: error: 'var' does not name a type
   41 | var input = file.split("\n");
      | ^~~
a.cc:42:1: error: 'var' does not name a type
   42 | var size = input[0];
      | ^~~
a.cc:43:1: error: 'var' does not name a type
   43 | var points = []
      | ^~~
a.cc:44:17: error: 'i' does not name a type
   44 | for (var i = 1; i < size+1; i++) {
      |                 ^
a.cc:44:29: error: 'i' does not name a type
   44 | for (var i = 1; i < size+1; i++) {
      |                             ^
a.cc:50:9: error: expected constructor, destructor, or type conversion before '(' token
   50 | find_bot(points, size);
      |         ^
a.cc:51:1: error: 'base_p' does not name a type
   51 | base_p = points[0];
      | ^~~~~~
a.cc:52:1: error: 'sorted_arr' does not name a type
   52 | sorted_arr = base_p.concat(points.subarray(1).sort(function (p1, p2) {
      | ^~~~~~~~~~
a.cc:58:2: error: expected unqualified-id before ')' token
   58 | }));
      |  ^
a.cc:59:1: error: 'console' does not name a type; did you mean 'const'?
   59 | console.log(points);
      | ^~~~~~~
      | const