criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>

using namespace std;

#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)

class Point{
public:
	double x, y;
	Point(double _x = 0, double _y = 0) :x(0), y(0){};

	Point operator+(const Point &p){ return Point(x + p.x, y + p.y); }
	Point operator-(const Point &p){ return Point(x - p.x, y - p.y); }
	Point operator*(const Point &p){ return Point(x * p.x, y * p.y); }
	Point operator/(const Point &p){ return Point(x / p.x, y / p.y); }

	double norm() { return x*x + y*y; }
	double abs() { return sqrt(norm()); }

	bool operator<(const Point &p) const{
		return (x != p.x) ? x < (p.x) : (y < p.y);
	}

	bool operator==(const Point &p){
		return equals(x, p.x) && equals(y, p.y);
	}
};

typedef Point Vector;

double dot(Vector a, Vector b){
	return a.x*b.x + a.y*b.y;
}

double cross(Vector a, Vector b){
	return a.x*b.y - a.y*b.x;
}

bool isOrthogonal(Vector a, Vector b){
	return equals(dot(a, b), 0.0);
}

bool isParallel(Vector a, Vector b){
	return equals(cross(a, b), 0.0);
}

int main(){
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		int x0, y0, x1, y1, x2, y2, x3, y3;
		cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		Vector v1(x1 - x0, y1 - y0);
		Vector v2(x3 - x2, y3 - y2);
		if (isParallel(v1, v2)) cout << 2 << endl;
		else if (isOrthogonal(v1, v2)) cout << 1 << endl;
		else cout << 0 << endl;
	}

}

Compiler output:
a.cc: In member function 'double Point::abs()':
a.cc:19:31: error: 'sqrt' was not declared in this scope
   19 |         double abs() { return sqrt(norm()); }
      |                               ^~~~
a.cc: In member function 'bool Point::operator==(const Point&)':
a.cc:6:23: error: 'fabs' was not declared in this scope; did you mean 'abs'?
    6 | #define equals(a, b) (fabs((a)-(b)) < EPS)
      |                       ^~~~
a.cc:26:24: note: in expansion of macro 'equals'
   26 |                 return equals(x, p.x) && equals(y, p.y);
      |                        ^~~~~~
a.cc: In function 'bool isOrthogonal(Vector, Vector)':
a.cc:6:23: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    6 | #define equals(a, b) (fabs((a)-(b)) < EPS)
      |                       ^~~~
a.cc:41:16: note: in expansion of macro 'equals'
   41 |         return equals(dot(a, b), 0.0);
      |                ^~~~~~
a.cc: In function 'bool isParallel(Vector, Vector)':
a.cc:6:23: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    6 | #define equals(a, b) (fabs((a)-(b)) < EPS)
      |                       ^~~~
a.cc:45:16: note: in expansion of macro 'equals'
   45 |         return equals(cross(a, b), 0.0);
      |                ^~~~~~
Language: C++

#include <iostream>
#include <math>

using namespace std;

#define EPS (1e-10)
#define equals(a, b) (abs((a)-(b)) < EPS)

class Point{
public:
	double x, y;
	Point(double _x = 0, double _y = 0) :x(0), y(0){};

	Point operator+(const Point &p){ return Point(x + p.x, y + p.y); }
	Point operator-(const Point &p){ return Point(x - p.x, y - p.y); }
	Point operator*(const Point &p){ return Point(x * p.x, y * p.y); }
	Point operator/(const Point &p){ return Point(x / p.x, y / p.y); }

	double norm() { return x*x + y*y; }
	double abs() { return sqrt(norm()); }

	bool operator<(const Point &p) const{
		return (x != p.x) ? x < (p.x) : (y < p.y);
	}

	bool operator==(const Point &p){
		return equals(x, p.x) && equals(y, p.y);
	}
};

typedef Point Vector;

double dot(Vector a, Vector b){
	return a.x*b.x + a.y*b.y;
}

double cross(Vector a, Vector b){
	return a.x*b.y - a.y*b.x;
}

bool isOrthogonal(Vector a, Vector b){
	return equals(dot(a, b), 0.0);
}

bool isParallel(Vector a, Vector b){
	return equals(cross(a, b), 0.0);
}

int main(){
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		int x0, y0, x1, y1, x2, y2, x3, y3;
		cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		Vector v1(x1 - x0, y1 - y0);
		Vector v2(x3 - x2, y3 - y2);
		if (isParallel(v1, v2)) cout << 2 << endl;
		else if (isOrthogonal(v1, v2)) cout << 1 << endl;
		else cout << 0 << endl;
	}

}

Compiler output:
a.cc:2:10: fatal error: math: No such file or directory
    2 | #include <math>
      |          ^~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <math.h>

using namespace std;

#define EPS (1e-10)
#define equals(a, b) (abs((a)-(b)) < EPS)

class Point{
public:
	double x, y;
	Point(double _x = 0, double _y = 0) :x(0), y(0){};

	Point operator+(const Point &p){ return Point(x + p.x, y + p.y); }
	Point operator-(const Point &p){ return Point(x - p.x, y - p.y); }
	Point operator*(const Point &p){ return Point(x * p.x, y * p.y); }
	Point operator/(const Point &p){ return Point(x / p.x, y / p.y); }

	double norm() { return x*x + y*y; }
	double abs() { return sqrt(norm()); }

	bool operator<(const Point &p) const{
		return (x != p.x) ? x < (p.x) : (y < p.y);
	}

	bool operator==(const Point &p){
		return equals(x, p.x) && equals(y, p.y);
	}
};

typedef Point Vector;

double dot(Vector a, Vector b){
	return a.x*b.x + a.y*b.y;
}

double cross(Vector a, Vector b){
	return a.x*b.y - a.y*b.x;
}

bool isOrthogonal(Vector a, Vector b){
	return equals(dot(a, b), 0.0);
}

bool isParallel(Vector a, Vector b){
	return equals(cross(a, b), 0.0);
}

int main(){
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		int x0, y0, x1, y1, x2, y2, x3, y3;
		cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		Vector v1(x1 - x0, y1 - y0);
		Vector v2(x3 - x2, y3 - y2);
		if (isParallel(v1, v2)) cout << 2 << endl;
		else if (isOrthogonal(v1, v2)) cout << 1 << endl;
		else cout << 0 << endl;
	}

}

Compiler output:
a.cc: In member function 'bool Point::operator==(const Point&)':
a.cc:7:26: error: no matching function for call to 'Point::abs(double)'
    7 | #define equals(a, b) (abs((a)-(b)) < EPS)
      |                       ~~~^~~~~~~~~
a.cc:27:24: note: in expansion of macro 'equals'
   27 |                 return equals(x, p.x) && equals(y, p.y);
      |                        ^~~~~~
a.cc:20:16: note: candidate: 'double Point::abs()'
   20 |         double abs() { return sqrt(norm()); }
      |                ^~~
a.cc:20:16: note:   candidate expects 0 arguments, 1 provided
a.cc:7:26: error: no matching function for call to 'Point::abs(double)'
    7 | #define equals(a, b) (abs((a)-(b)) < EPS)
      |                       ~~~^~~~~~~~~
a.cc:27:42: note: in expansion of macro 'equals'
   27 |                 return equals(x, p.x) && equals(y, p.y);
      |                                          ^~~~~~
a.cc:20:16: note: candidate: 'double Point::abs()'
   20 |         double abs() { return sqrt(norm()); }
      |                ^~~
a.cc:20:16: note:   candidate expects 0 arguments, 1 provided
Language: C++

#include <iostream>
#include <cstdio>
#include <complex>
using namespace std;

typedef long long lli;
typedef complex<lli> point;

lli dot(point a,point b){
	return (a*conj(b)).real();
}

lli double cross(point a,point b){
	return (a*conj(b)).imag();
}

int main(void){
	double x,y;
	int q;
	cin>>q;
	while(q--){
		cin>>x>>y;
		point p0(x,y);
		cin>>x>>y;
		point p1(x,y);
		cin>>x>>y;
		point p2(x,y);
		cin>>x>>y;
		point p3(x,y);
		point l1=p1-p0;
		point l2=p3-p2;
		if(cross(l1,l2)==0)cout<<"2"<<endl;
		else if(dot(l1,l2)==0)cout<<"1"<<endl;
		else cout<<"0"<<endl;
		return 0;
	}

Compiler output:
a.cc:13:1: error: two or more data types in declaration of 'cross'
   13 | lli double cross(point a,point b){
      | ^~~
a.cc: In function 'int main()':
a.cc:32:20: error: 'cross' was not declared in this scope
   32 |                 if(cross(l1,l2)==0)cout<<"2"<<endl;
      |                    ^~~~~
a.cc:36:10: error: expected '}' at end of input
   36 |         }
      |          ^
a.cc:17:15: note: to match this '{'
   17 | int main(void){
      |               ^
Language: C++

#include <iostream>
using namespace std;

//#define equals( a, b ) (fabs((a) - (b)) < DBL_E)

class Vector2 {
public:
	Vector2(double x_, double y_) : x(x_), y(y_) {}
	Vector2() : x(0), y(0) {}
	Vector2 operator -(Vector2& other) {
		Vector2 vec(x - other.GetX(), y - other.GetY());
		return vec;
	}
	void SetVector2(double x_, double y_) {
		x = x_;
		y = y_;
	}
	double GetX() {
		return x;
	}
	double GetY() {
		return y;
	}

private:
	double x, y;
};

double Dot(Vector2 vecA, Vector2 vecB) {
	return vecA.GetX() * vecB.GetX() + vecA.GetY() * vecB.GetY();
}

double CrossY(Vector2 vecA, Vector2 vecB) {
	return vecA.GetX() * vecB.GetY() - vecA.GetY() * vecB.GetX();
}

bool IsOrthogonal(Vector2 vecA, Vector2 vecB) {
    double ans = Dot(vecA, vecB);
//	return equals(ans, 0.0);
	return (fabs(ans - 0) < DBL_EPSILON);
}

bool IsParallel(Vector2 vecA, Vector2 vecB) {
	double ans = CrossY(vecA, vecB);
	return (fabs(ans - 0) < DBL_EPSILON);
}

int main() {
	int query;
	cin >> query;

	for (int i = 0; i < query; i++) {
		Vector2 vecs[4];
		for (int i = 0; i < 4; i++) {
			double x, y;
			cin >> x >> y;
			vecs[i].SetVector2(x, y);
		}

		Vector2 vecA = vecs[1] - vecs[0];
		Vector2 vecB = vecs[3] - vecs[2];
		bool orth = IsOrthogonal(vecA, vecB);
		if (orth) {
			cout << 1 << endl;
			continue;
		}

		bool para = IsParallel(vecA, vecB);
		if (para) {
			cout << 2 << endl;
			continue;
		}
		cout << 0 << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool IsOrthogonal(Vector2, Vector2)':
a.cc:40:17: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   40 |         return (fabs(ans - 0) < DBL_EPSILON);
      |                 ^~~~
      |                 labs
a.cc:40:33: error: 'DBL_EPSILON' was not declared in this scope
   40 |         return (fabs(ans - 0) < DBL_EPSILON);
      |                                 ^~~~~~~~~~~
a.cc: In function 'bool IsParallel(Vector2, Vector2)':
a.cc:45:17: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   45 |         return (fabs(ans - 0) < DBL_EPSILON);
      |                 ^~~~
      |                 labs
a.cc:45:33: error: 'DBL_EPSILON' was not declared in this scope
   45 |         return (fabs(ans - 0) < DBL_EPSILON);
      |                                 ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdlib>
using namespace std;

//#define equals( a, b ) (fabs((a) - (b)) < DBL_E)

class Vector2 {
public:
	Vector2(double x_, double y_) : x(x_), y(y_) {}
	Vector2() : x(0), y(0) {}
	Vector2 operator -(Vector2& other) {
		Vector2 vec(x - other.GetX(), y - other.GetY());
		return vec;
	}
	void SetVector2(double x_, double y_) {
		x = x_;
		y = y_;
	}
	double GetX() {
		return x;
	}
	double GetY() {
		return y;
	}

private:
	double x, y;
};

double Dot(Vector2 vecA, Vector2 vecB) {
	return vecA.GetX() * vecB.GetX() + vecA.GetY() * vecB.GetY();
}

double CrossY(Vector2 vecA, Vector2 vecB) {
	return vecA.GetX() * vecB.GetY() - vecA.GetY() * vecB.GetX();
}

bool IsOrthogonal(Vector2 vecA, Vector2 vecB) {
    double ans = Dot(vecA, vecB);
//	return equals(ans, 0.0);
	return (fabs(ans) < DBL_EPSILON);
}

bool IsParallel(Vector2 vecA, Vector2 vecB) {
	double ans = CrossY(vecA, vecB);
	return (fabs(ans) < DBL_EPSILON);
}

int main() {
	int query;
	cin >> query;

	for (int i = 0; i < query; i++) {
		Vector2 vecs[4];
		for (int i = 0; i < 4; i++) {
			double x, y;
			cin >> x >> y;
			vecs[i].SetVector2(x, y);
		}

		Vector2 vecA = vecs[1] - vecs[0];
		Vector2 vecB = vecs[3] - vecs[2];
		bool orth = IsOrthogonal(vecA, vecB);
		if (orth) {
			cout << 1 << endl;
			continue;
		}

		bool para = IsParallel(vecA, vecB);
		if (para) {
			cout << 2 << endl;
			continue;
		}
		cout << 0 << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool IsOrthogonal(Vector2, Vector2)':
a.cc:41:17: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   41 |         return (fabs(ans) < DBL_EPSILON);
      |                 ^~~~
      |                 labs
a.cc:41:29: error: 'DBL_EPSILON' was not declared in this scope
   41 |         return (fabs(ans) < DBL_EPSILON);
      |                             ^~~~~~~~~~~
a.cc: In function 'bool IsParallel(Vector2, Vector2)':
a.cc:46:17: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   46 |         return (fabs(ans) < DBL_EPSILON);
      |                 ^~~~
      |                 labs
a.cc:46:29: error: 'DBL_EPSILON' was not declared in this scope
   46 |         return (fabs(ans) < DBL_EPSILON);
      |                             ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdlib>
using namespace std;

//#define equals( a, b ) (fabs((a) - (b)) < DBL_E)

class Vector2 {
public:
	Vector2(double x_, double y_) : x(x_), y(y_) {}
	Vector2() : x(0), y(0) {}
	Vector2 operator -(Vector2& other) {
		Vector2 vec(x - other.GetX(), y - other.GetY());
		return vec;
	}
	void SetVector2(double x_, double y_) {
		x = x_;
		y = y_;
	}
	double GetX() {
		return x;
	}
	double GetY() {
		return y;
	}

private:
	double x, y;
};

double Dot(Vector2 vecA, Vector2 vecB) {
	return vecA.GetX() * vecB.GetX() + vecA.GetY() * vecB.GetY();
}

double CrossY(Vector2 vecA, Vector2 vecB) {
	return vecA.GetX() * vecB.GetY() - vecA.GetY() * vecB.GetX();
}

bool IsOrthogonal(Vector2 vecA, Vector2 vecB) {
    double ans = Dot(vecA, vecB);
//	return equals(ans, 0.0);
//	return (fabs(ans) < DBL_EPSILON);
	return (fabs(ans) < 0.1f);
}

bool IsParallel(Vector2 vecA, Vector2 vecB) {
	double ans = CrossY(vecA, vecB);
//	return (fabs(ans) < DBL_EPSILON);
	return (fabs(ans) < 0.1f);
}

int main() {
	int query;
	cin >> query;

	for (int i = 0; i < query; i++) {
		Vector2 vecs[4];
		for (int i = 0; i < 4; i++) {
			double x, y;
			cin >> x >> y;
			vecs[i].SetVector2(x, y);
		}

		Vector2 vecA = vecs[1] - vecs[0];
		Vector2 vecB = vecs[3] - vecs[2];
		bool orth = IsOrthogonal(vecA, vecB);
		if (orth) {
			cout << 1 << endl;
			continue;
		}

		bool para = IsParallel(vecA, vecB);
		if (para) {
			cout << 2 << endl;
			continue;
		}
		cout << 0 << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'bool IsOrthogonal(Vector2, Vector2)':
a.cc:42:17: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   42 |         return (fabs(ans) < 0.1f);
      |                 ^~~~
      |                 labs
a.cc: In function 'bool IsParallel(Vector2, Vector2)':
a.cc:48:17: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   48 |         return (fabs(ans) < 0.1f);
      |                 ^~~~
      |                 labs
Language: Java

// package codecheck;

import java.util.Scanner;
import java.util.Arrays;

class Point implements Comparable<Point> {
        double x;
        double y;

        public Point(double x, double y) {
            this.x = x;
            this.y = y;
        }

        public int compareTo(Point o) {
            if (Math.abs(x - o.x) > EPS)
                return (int) Math.signum(x - o.x);
            else
                return (int) Math.signum(y - o.y);
        }

        Point add(Point p) {
            return new Point(x + p.x, y + p.y);
        }
     
        Point subtract(Point p) {
            return new Point(x - p.x, y - p.y);
        }
     
        Point multiply(double k) {
            return new Point(x * k, y * k);
        }
     
        Point devide(double k) {
            return new Point(x / k, y / k);
        }
    }

    class Segment {
        Point p1;
        Point p2;
     
        public Segment(Point p1, Point p2) {
            this.p1 = p1;
            this.p2 = p2;
        }
    }

class Geometries {
    static double EPS = 1e-9;
    

    static double exteriorProduct(Point p1, Point p2) {
        return p1.x * p2.y - p1.y * p2.x;
    }

    static boolean cross(Segment s1, Segment s2) {
        boolean b1 = exteriorProduct(s1.p2.subtract(s1.p1), s2.p1) * exteriorProduct(s1.p2.subtract(s1.p1), s2.p2)  < EPS ;
        boolean b2 = exteriorProduct(s2.p2.subtract(s2.p1), s1.p1) * exteriorProduct(s2.p2.subtract(s2.p1), s1.p2)  < EPS ;
        return b1 && b2;
    }
}


public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
        String line;
        String[] words;
 
        int q = sc.nextInt();
 
        for (int i = 0; i < q; i++) {
            double xp0, yp0, xp1, yp1, xp2, yp2, xp3, yp3;
            xp0 = sc.nextDouble();
            yp0 = sc.nextDouble();
            xp1 = sc.nextDouble();
            yp1 = sc.nextDouble();
            xp2 = sc.nextDouble();
            yp2 = sc.nextDouble();
            xp3 = sc.nextDouble();
            yp3 = sc.nextDouble();
 
            Point p0, p1, p2, p3;
            p0 = new Point(xp0, yp0);
            p1 = new Point(xp1, yp1);
            p2 = new Point(xp2, yp2);
            p3 = new Point(xp3, yp3);

            Segment s1, s2;
            s1 = new Segment(p0, p1);
            s2 = new Segment(p2, p3);
 
            if (Geometries.cross(s1, s2)) {
                System.out.println(1);
            } else {
                System.out.println(0);
            }
        }

  }
}



Compiler output:
Main.java:16: error: cannot find symbol
            if (Math.abs(x - o.x) > EPS)
                                    ^
  symbol:   variable EPS
  location: class Point
1 error
Language: Java

// package codecheck;

import java.util.Scanner;
import java.util.Arrays;

class Point implements Comparable<Point> {
    static double EPS = 1e-9;
    double x;
    double y;

    public Point(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public int compareTo(Point o) {
        if (Math.abs(x - o.x) > EPS)
            return (int) Math.signum(x - o.x);
        else
            return (int) Math.signum(y - o.y);
    }

    Point add(Point p) {
        return new Point(x + p.x, y + p.y);
    }
 
    Point subtract(Point p) {
        return new Point(x - p.x, y - p.y);
    }
 
    Point multiply(double k) {
        return new Point(x * k, y * k);
    }
 
    Point devide(double k) {
        return new Point(x / k, y / k);
    }
}

class Segment {
    Point p1;
    Point p2;
 
    public Segment(Point p1, Point p2) {
        this.p1 = p1;
        this.p2 = p2;
    }
}

class Geometries {
    static double EPS = 1e-9;
    static double exteriorProduct(Point p1, Point p2) {
        return p1.x * p2.y - p1.y * p2.x;
    }

    static boolean cross(Segment s1, Segment s2) {
        boolean b1 = exteriorProduct(s1.p2.subtract(s1.p1), s2.p1.subtract(s1.p1)) * exteriorProduct(s1.p2.subtract(s1.p1), s2.p2.subtract(s1.p1))  < EPS ;
        boolean b2 = exteriorProduct(s2.p2.subtract(s2.p1), s1.p1.subtract(s2.p1)) * exteriorProduct(s2.p2.subtract(s2.p1), s1.p2subtract(s2.p1))  < EPS ;
        return b1 && b2;
    }
}


public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
        String line;
        String[] words;
 
        int q = sc.nextInt();
 
        for (int i = 0; i < q; i++) {
            double xp0, yp0, xp1, yp1, xp2, yp2, xp3, yp3;
            xp0 = sc.nextDouble();
            yp0 = sc.nextDouble();
            xp1 = sc.nextDouble();
            yp1 = sc.nextDouble();
            xp2 = sc.nextDouble();
            yp2 = sc.nextDouble();
            xp3 = sc.nextDouble();
            yp3 = sc.nextDouble();
 
            Point p0, p1, p2, p3;
            p0 = new Point(xp0, yp0);
            p1 = new Point(xp1, yp1);
            p2 = new Point(xp2, yp2);
            p3 = new Point(xp3, yp3);

            Segment s1, s2;
            s1 = new Segment(p0, p1);
            s2 = new Segment(p2, p3);
 
            if (Geometries.cross(s1, s2)) {
                System.out.println(1);
            } else {
                System.out.println(0);
            }
        }

  }
}



Compiler output:
Main.java:58: error: cannot find symbol
        boolean b2 = exteriorProduct(s2.p2.subtract(s2.p1), s1.p1.subtract(s2.p1)) * exteriorProduct(s2.p2.subtract(s2.p1), s1.p2subtract(s2.p1))  < EPS ;
                                                                                                                              ^
  symbol:   method p2subtract(Point)
  location: variable s1 of type Segment
1 error
Language: C

#include <stdio.h>
int main(void){
   int i, n, x0, y0, x1, y1, x2, y2, x3, y3, l0, l1, l2, l3;
   scanf("%d", &n);
for (i = 0; i < n; i++){
    scanf("%d %d %d %d %d %d %d %d", &x0, &y0, &x1, &y1, &x2, &y2, &x3, &y3);
    l0 = (x1 - x2)*(x3 - x1) + (y1 - y2)*(y1 - y3);
    l1 = (x1 - x2)*(x4 - x1) + (y1 - y2)*(y1 - y4);
    l2 = (x3 - x4)*(x1 - x3) + (y3 - y4)*(y3 - y1);
    l3 = (x3 - x4)*(x2 - x3) + (y3 - y4)*(y3 - y2);
    if(l0 * l1 < 0 && l2 * l3 < 0){
        printf("1\n");
    }else{
        printf("0\n");
    }

    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:8:21: error: 'x4' undeclared (first use in this function); did you mean 'x3'?
    8 |     l1 = (x1 - x2)*(x4 - x1) + (y1 - y2)*(y1 - y4);
      |                     ^~
      |                     x3
main.c:8:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:48: error: 'y4' undeclared (first use in this function); did you mean 'y3'?
    8 |     l1 = (x1 - x2)*(x4 - x1) + (y1 - y2)*(y1 - y4);
      |                                                ^~
      |                                                y3
main.c:18:1: error: expected declaration or statement at end of input
   18 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
   int i, n, x1, y1, x2, y2, x3, y3, x4, y4, l0, l1, l2, l3;
   scanf("%d", &n);
for (i = 0; i < n; i++){
    scanf("%d %d %d %d %d %d %d %d", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);
    l0 = (x1 - x2)*(x3 - x1) + (y1 - y2)*(y1 - y3);
    l1 = (x1 - x2)*(x4 - x1) + (y1 - y2)*(y1 - y4);
    l2 = (x3 - x4)*(x1 - x3) + (y3 - y4)*(y3 - y1);
    l3 = (x3 - x4)*(x2 - x3) + (y3 - y4)*(y3 - y2);
    if(l0 * l1 < 0 && l2 * l3 < 0){
        printf("1\n");
    }else{
        printf("0\n");
    }

    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:18:1: error: expected declaration or statement at end of input
   18 | }
      | ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;

const double eps = 1e-9;
inline bool equals(double a, double b) { return fabs(a - b) < eps ;}

class Point {
public:
    double x, y;

    Point(double x = 0, double y = 0): x(x), y(y) {};

    Point operator + (Point p) { return Point(x + p.x, y + p.y); }
    Point operator - (Point p) { return Point(x - p.x, y - p.y); }
    Point operator * (double a) { return Point(a * x, a * y); }
    Point operator / (double a) { return Point(x / a, y / a); }

    double abs() { return sqrt(norm()); }
    double norm() { return x * x + y * y; }

    bool operator < (const Point &p) const {
        return x != p.x ? x < p.x : y < p.y;
    }

    bool operator == (const Point &p) const {
        return fabs(x - p.x) < eps && fabs(y - p.y) < eps;
    }
};

struct Segment {Point p1, p2;};

bool intersect(Point p1, Point p2, Point p3, Point p4) {
    double tc = (p1.x - p2.x) * (p3.y - p1.y) + (p1.y - p2.y) * (p1.x - x3.x);
    double td = (p1.x - p2.x) * (p4.y - p1.y) + (p1.y - p2.y) * (p1.x - x4.x);
    return tc * td < 0;
}

bool intersect(Segment s1, Segment s2) {
    return intersect(s1.p1, s1.p2, s2.p1, s2.p2);
}

int main(void) {
    int q;
    cin >> q;
    while (q--) {
        double x0, y0, x1, y1, x2, y2, x3, y3;
        cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        Segment s1 = {Point(x0, y0), Point(x1, y1)};
        Segment s2 = {Point(x2, y2), Point(x3, y3)};
        cout << intersect(s1, s2) ? 1 : 0 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'bool intersect(Point, Point, Point, Point)':
a.cc:34:73: error: 'x3' was not declared in this scope; did you mean 'p3'?
   34 |     double tc = (p1.x - p2.x) * (p3.y - p1.y) + (p1.y - p2.y) * (p1.x - x3.x);
      |                                                                         ^~
      |                                                                         p3
a.cc:35:73: error: 'x4' was not declared in this scope; did you mean 'p4'?
   35 |     double td = (p1.x - p2.x) * (p4.y - p1.y) + (p1.y - p2.y) * (p1.x - x4.x);
      |                                                                         ^~
      |                                                                         p4
a.cc: In function 'int main()':
a.cc:51:43: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   51 |         cout << intersect(s1, s2) ? 1 : 0 << endl;
      |                                         ~~^~~~~~~
Language: C++

#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <climits>

using namespace std;

#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

//???
class Point {
public:
    double x, y;
    
    Point (double x = 0, double y = 0):x(x), y(y){}
    Point operator + (Point p){return Point(x + p.x, y + p.y);}
    Point operator - (Point p){return Point(x - p.x, y - p.y);}
    Point operator * (double a){return Point(a * x, a * y);}
    Point operator / (double a){return Point(x / a, y / a);}
    
    double norm(){return x*x + y*y;};
    double absolute(){return sqrt(norm());};
    
    bool operator < (const Point &p) const{
        return x != p.x ? x < p.x : y < p.y;
    }
    
    bool operator == (const Point &p) const{
        return equals(x, p.x) && equals(y, p.y);
    }
    
};
typedef Point Vector;                               //????????????
typedef struct Segment{Point p1, p2;}Segment;       //??????

//????????????a,b?????????
double dot(Vector a, Vector b){
    return a.x * b.x + a.y * b.y;
}
//????????????a,b?????????
double cross(Vector a, Vector b){
    return a.x * b.y - a.y * b.x;
}

//??????p0, p1, p2???????????????????????????p0p1???????????????p2??????????????????
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;
int ccw(Point p0, Point p1, Point p2){
    Vector a = p1 - p0;
    Vector b = p2 - p0;
    if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
    if(cross(a, b) < -EPS) return CLOCKWISE;
    if(dot(a, b) < -EPS) return ONLINE_BACK;
    if(norm(a) < norm(b)) return ONLINE_FRONT;
    return ON_SEGMENT;
}

//??????S1(p1p2)??¨??????s2(p2p3)????????????????????????
bool intersect(Point p1, Point p2, Point p3, Point p4){
    return  ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0
            &&
            ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0;
}
bool intersect(Segment s1, Segment s2){
    return intersect(s1.p1, s1.p2, s2.p1, s2.p1);
}


int main(){
    
    int x0, y0, x1, y1, x2, y2, x3, y3;
    
    int q;
    
    cin >> q;
    
    for (int i = 0; i < q; i++) {
        cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        
        Point p0 = Point(x0, y0);
        Point p1 = Point(x1, y1);
        Point p2 = Point(x2, y2);
        Point p3 = Point(x3, y3);
        
        
        if( intersect(p0, p1, p2, p3) ) cout << 1 << endl;
        else cout << 0 << endl;
    }


    return 0;
}

Compiler output:
a.cc: In function 'int ccw(Point, Point, Point)':
a.cc:60:8: error: 'norm' was not declared in this scope
   60 |     if(norm(a) < norm(b)) return ONLINE_FRONT;
      |        ^~~~
Language: C

#include <math.h>
#include <stdio.h>

#define swap( x, y ) do { double tmp; tmp = x; x = y; y = tmp; } while ( 0 )
#define EPS 1e-10

int rel_s_s( double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, double *x, double *y ) {
	double dn = ( x2 - x1 ) * ( y4 - y3 ) - ( x4 - x3 ) * ( y2 - y1 );
	double nm = ( x3 - x1 ) * ( y4 - y3 ) - ( x4 - x3 ) * ( y3 - y1 );

	if ( fabs( dn ) < EPS )
		if ( fabs( nm ) < EPS ) {
			if ( x1 == x2 ) {
				if ( y2 < y1 )
					swap( y1, y2 );
				if ( y4 < y3 )
					swap( y3, y4 );

				if ( y4 < y1 || y2 < y3 )
					return 3;
				else if ( y4 == y1 || y2 == y3 ) {
					*x = x1
					*y = y4 == y1 ? y1 : y2;
					return 4;
				} else
					return 5;
			} else {
				if ( x2 < x1 ) {
					swap( x1, x2 );
					swap( y1, y2 );
				}
				if ( x4 < x3 )
					swap( x3, x4 );

				if ( x4 < x1 || x2 < x3 )
					return 3;
				else if ( x4 == x1 || x2 == x3 ) {
					*x = x4 == x1 ? x1 : x2;
					*y = x4 == x1 ? y1 : y2;
					return 4;
				} else
					return 5;
			}
		} else
			return 2;
	else
		if ( fabs( nm / dn - 0.5 ) < 0.5 + EPS && fabs( ( ( x3 - x1 ) * ( y2 - y1 ) - ( x2 - x1 ) * ( y3 - y1 ) ) / dn - 0.5 ) < 0.5 + EPS ) {
			*x = x1 + nm / dn * ( x2 - x1 );
			*y = y1 + nm / dn * ( y2 - y1 );

			if ( fabs( ( x2 - x1 ) * ( x4 - x3 ) + ( y2 - y1 ) * ( y4 - y3 ) ) < EPS )
				return 1;
			else
				return 0;
		} else
			return 6;
}

int main( void ) {
	int q;

	scanf( "%d", &q );
	while ( q-- ) {
		double x0, y0, x1, y1, x2, y2, x3, y3, x, y;

		scanf( "%lf %lf %lf %lf %lf %lf %lf %lf", &x0, &y0, &x1, &y1, &x2, &y2, &x3, &y3 );

		rel_s_s( x0, y0, x1, y1, x2, y2, x3, y3, &x, &y );
		printf( "%.8f %.8f\n", x, y );
	}

	return 0;
}

Compiler output:
main.c: In function 'rel_s_s':
main.c:23:41: error: invalid operands to binary * (have 'double' and 'double *')
   23 |                                         *y = y4 == y1 ? y1 : y2;
      |                                         ^
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
 
const double EPS = 1E-10;
typedef vector<double> vec;
typedef vector<vec> mat;
 
vec gauss_jordan(const mat& A, const vec& b) {
  int n = A.size();
  mat B(n, vec(n+1));
  for(int i=0; i<n; i++) {
    for(int j=0; j<n; j++) {
      B[i][j] = A[i][j];
    }
  }
 
  for(int i=0; i<n; i++) B[i][n] = b[i];
   
  for(int i=0; i<n; i++) {
    int pivot = i;
    for(int j=i; j<n; j++) {
      if(fabs(B[j][i]) > fabs(B[pivot][i])) pivot = j;
    }
    swap(B[i], B[pivot]);
 
    if(fabs(B[i][i]) < EPS) return vec();
     
    for(int j=i+1; j<=n; j++) B[i][j] /= B[i][i];
    for(int j=0; j<n; j++) {
      if(i != j) {
    for(int k=i+1; k<=n; k++) B[j][k] -= B[j][i] * B[i][k];
      }
    }
  }
  vec x(n);
  for(int i=0; i<n; i++) x[i] = B[i][n];
  return x;
}
 
int main() {
  int n;
   
  double x[4], y[4];
   
  cin >> n;
  for(int i=0; i<n; i++) {
    mat A;
    vec a, b;
    for(int j=0; j<4; j++) {
      cin >> x[j] >> y[j];
    }
     
    a.push_back(y[1]-y[0]);
    a.push_back(x[0]-x[1]);
    A.push_back(a);
     
    b.push_back(( y[1]-y[0] ) * x[0] - ( x[1]-x[0] ) * y[0]);
     
    a.clear();
    a.push_back(y[3]-y[2]);
    a.push_back(x[2]-x[3]);
    A.push_back(a);
     
    b.push_back(( y[3]-y[2] ) * x[2] - ( x[3]-x[2] ) * y[2]);
     
     
    vec ans(2);
    ans = gauss_jordan(A, b);
     
    //if(fabs(ans[0]) < EPS) ans[0] = 0.0;
    //if(fabs(ans[1]) < EPS) ans[0] = 0.0;
    printf("%.10lf %.10lf\n", ans[0], ans[1]);
  }
   
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#ifndef _WIN32
#include<iostream>
#endif

#include <complex>
#include <vector>
#include <utility>
#include <tuple>
#include <algorithm>
using namespace std;


#define FOR(i,bg,ed) for(int i = (bg);<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back

#define IL inline
namespace geo{
	typedef double D;
	typedef bool B;
	typedef complex<D> P;
#define X real()
#define Y imag()
	B comp(const P& l, const P& r)
	{
		return (l.X == r.X) ? l.Y < r.Y : l.X < r.X;
	}
	typedef pair<P, P> L;
	typedef pair<P, P> LS;
	typedef pair<P, D> C;
	typedef vector<P> Poly;
	const D EPS = 1e-8;

	//Decomposition Macro
#define DCI(a,b,l) P(a),(b);tie(a,b)=l;
#define DCc(a,b,c) P(a);D(b);tie(a,b)=c;

	//A dot B
	IL D dot(P a, P b)
	{
		return a.X*b.X + a.Y*b.Y;
	}
	IL D cross(P a, P b)
	{
		return a.X*b.Y - a.Y*b.X;
	}
	IL D ccw(P a, P b, P c)
	{
		return cross(b - a, c - a);
	}

	IL int sgn(P a, P b, P c){
		if (cross(b - a, c - a) > EPS)return 1;
		if (cross(b - a, c - a) < -EPS)return -1;
		if (dot(b - a, c - a) < -EPS)return 2;
		if (dot(a - b, c - b) < -EPS)return -2;
		return 0;
	}
	IL D signed_distance_P_L(P p, L l){
		DCI(a, b, l);
		return cross(b - a, p - a) / abs(b - a);
	}
	IL D dinstance_P_L(P p, L l){
		return abs(signed_distance_P_L(p, l));
	}
	IL D distance_P_LS(P p, LS ls){
		DCI(a, b, ls);
		if (dot(b - a, p - a) < EPS)return abs(p - a);
		if (dot(a - b, p - b) < EPS)return abs(p - b);
		return abs(cross(b - a, p - a)) / abs(b - a);
	}

	IL B is_L_L(L p, L q){
		DCI(a, b, p);
		DCI(c, d, q);
		return abs(cross(a - b, c - d))>EPS ||
			abs(cross(a - b, d - b)) < EPS; 
	}
	IL B is_LS_LS(LS p, LS q){
		DCI(a, b, p);
		DCI(c, d, q);
		return sgn(a, b, c) * sgn(a, b, d) <= 0 &&
			sgn(c, d, a) * sgn(c, d, b) <= 0;
	}
	IL D distance_LS_LS(LS p, LS q){
		if (is_LS_LS(p, q))
			return 0;
		return
			min({ distance_P_LS(p.fi, q) ,
			 distance_P_LS(p.se, q) ,
			 distance_P_LS(q.fi, q) ,
			 distance_P_LS(q.se, q) });
	}
	IL P cross_point_L_L(L p, L q){
		DCI(a, b, p);
		D d1 = signed_distance_P_L(a, q);
		D d2 = signed_distance_P_L(b, q);
		return (a*d2 - b*d1) / (d2 - d1);
	}
}

using namespace geo;


int main()
{
	int n;

	cin >> n;
	while (n--){
		D x1, x2, x3, y1, y2, y3, x4, y4;

		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		P a(x1 - x2, y1 - y2), b(x3 - x4, y3 - y4);

		P p(x1,y1),q(x2,y2),r(x3,y3),s(x4,y4);

		cout << setprecision(9) << endl;

		auto ans = cross_point_L_L({ p, q }, { r, s });
		cout << ans.X << " " << ans.Y  << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:121:25: error: 'setprecision' was not declared in this scope
  121 |                 cout << setprecision(9) << endl;
      |                         ^~~~~~~~~~~~
a.cc:10:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    9 | #include <algorithm>
  +++ |+#include <iomanip>
   10 | using namespace std;
Language: C++

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;

class Vector
{
public:
	double x,y;
	Vector (double x=0,double y=0):x(x),y(y){}
	
	Vector operator + (Vector p){return Vector(x+p.x,y+p.y);}
	Vector operator - (Vector p){return Vector(x-p.x,y-p.y);}
	Vector operator * (double a){return Vector(x*a,y*a);}
	Vector operator / (double a){return Vector(x/a,y/a);}
	
	double abs() {return sqrt(norm());}
	double norm(){return x*x+y*y;}
};

double cross(Vector a,Vector b)
{
	return abs(a.x*b.y-b.x*a.y);
}

int main()
{
	int n;cin>>n;
	Vector p0,p1,p2,p3;
	cout<<fixed<<setprecision(10);
	for(int i=0;i<n;i++)
	{
		cin>>p0.x>>p0.y>>p1.x>>p1.y>>p2.x>>p2.y>>p3.x>>p3.y;
		Vector base=p3-p2;
		Vector hypo1=p0-p2;
		Vector hypo2=p1-p3;
		
		double d1=cross(base,hypo1);
		double d2=cross(base,hypo2);
		
		double t=d1/(d1+d2);
		Vector x=p0+(p1-p0)*t;
		cout<<x.x<<" "<x.y<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:35: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator<<'
   43 |                 cout<<x.x<<" "<x.y<<endl;
      |                                ~~~^~~~~~
Language: C++

#include <iostream>
#include <complex>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <windows.h> 
using namespace std;
typedef complex<double> xy;
double eps = 1e-9;
double dot_product(xy a,xy b) {return (conj(a)*b).real();}
double cross_product(xy a,xy b) {return (conj(a)*b).imag();}
double dist_lp(xy a1,xy a2,xy p){
    if(dot_product(a2-a1,p-a1)<eps) return abs(p-a1);
    if(dot_product(a1-a2,p-a2)<eps) return abs(p-a2);
    return abs(cross_product(a2-a1,p-a1))/abs(a2-a1);
}
xy projection(xy p,xy b) {return b*dot_product(p,b)/norm(b);}
xy projection2(xy p1,xy p2,xy p){
    p -= p1; p2 -= p1;
    xy proj = projection(p,p2);
    return p1+proj;
}

bool is_online(xy a1,xy a2,xy p){
    return abs(a1-p)+abs(a2-p)<=abs(a1-a2)+eps;    
}

bool is_intersected(xy a1, xy a2, xy b1, xy b2){
    if(is_online(a1,a2,b1) || is_online(a1,a2,b2)) return true;
    if(is_online(b1,b2,a1) || is_online(b1,b2,a2)) return true;
    return (cross_product(a2-a1,b1-a1)*cross_product(a2-a1,b2-a1)<-eps) && 
    (cross_product(b2-b1,a1-b1)*cross_product(b2-b1,a2-b1))<-eps;
}

double dist_ll(xy a1,xy a2,xy b1,xy b2){
    if(is_intersected(a1,a2,b1,b2)) return 0;
    return min({dist_lp(a1,a2,b1),dist_lp(a1,a2,b2),dist_lp(b1,b2,a1),dist_lp(b1,b2,a1)
    ,abs(a1-b1),abs(a1-b2),abs(a2-b1),abs(a2-b2)});   
}

int Q;
double X[5],Y[5];
int main(){
    cin >> Q;
    for(int i=0;i<Q;i++){
        for(int j=1;j<=4;j++){
            cin >> X[j] >> Y[j];
        }
        cout << fixed;
        cout << setprecision(10) << dist_ll(xy(X[1],Y[1]),xy(X[2],Y[2]),xy(X[3],Y[3]),xy(X[4],Y[4])) << endl;       
    }
}


Compiler output:
a.cc:6:10: fatal error: windows.h: No such file or directory
    6 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef complex<double> P;
typedef vector<P> Polygon;

#define prev(G, i) ( G[(i-1 + G.size()) % G.size()] )
#define curr(G, i) ( G[i] )
#define next(G, i) ( G[(i+1) % G.size()] )

double cross(P const& a, P const& b) {
  return imag(conj(a)*b);
}

double area(Polygon const& G) {
  double A = 0;
  for (int i=0; i<(int)G.size(); i++) 
    A += cross(curr(G, i), next(G, i));
  return A/2.;
}

int main() {
  
  int N; cin >> N;
  Polygon G(N);
  rep(i, N) cin >> G[i].real() >> G[i].imag();
  printf("%.10f\n", area(G));
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: 'i' was not declared in this scope
   26 |   rep(i, N) cin >> G[i].real() >> G[i].imag();
      |       ^
a.cc:26:3: error: 'rep' was not declared in this scope
   26 |   rep(i, N) cin >> G[i].real() >> G[i].imag();
      |   ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <complex>
#include <cmath>

using namespace std;

typedef complex<double> xy_t;
xy_t P[110];

int main (){
	int N;
	cin >> N;
	double x, y;
	int i = 0
	while (i < N){
		P[i++] = xy_t(x,y);
	}
	double sum = 0.0;
	for(int i = 0; i < N - 2; i++){
		xy_t a = P[0], b = P[(i+1) % N] , c = P[(i+2) % N];	
		sum += ((b.real()-a.real())*(c.imag()-a.imag()) - (b.imag()-a.imag())*(c.real()-a.real()));
	}
	printf("%.6f\n" , abs(sum)/2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected ',' or ';' before 'while'
   16 |         while (i < N){
      |         ^~~~~
Language: C++

#include <iostream>
#include <complex>
#include <cmath>
#include <cstandardio>
using namespace std;
typedef complex<double> xy_t;
xy_t P[110];

double cross_product(xy_t a , xy_t b){
	return (conj(a)*b).imag();
}

int main(){
	int i,n;
	double x,y,area;
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		scanf("%lf %lf\n",&x,&y);
		P[i]= xy_t(x,y);
	}//読み込み

	double areasum = 0.0;
	for(i=2;i<n;i++){
		area = cross_product(P[i]-P[0],P[i-1]-P[0])/2;
		areasum += area;
	}

	areasum = fabs(areasum);
	printf("%.1f\n",areasum);;
	return 0;	

}

Compiler output:
a.cc:4:10: fatal error: cstandardio: No such file or directory
    4 | #include <cstandardio>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <cctype>
#include <limits.h>
#include <math.h>
#include <complex>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()
const int INF = 1e9;
const double PI = 3.14159;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef long long ll;
//typedef pair<int, int> P;

/* struct P {
	int x, y, n;
	P(int n, int x, int y):n(n), x(x), y(y){}
	P(){}
}; */


/** 幾何ライブラリ **/
#include <complex>

#define X real()
#define Y imag()

const double EPS = 1e-11;

typedef double D;
typedef complex<D> P; // Point

struct L { // Line
	P a, b;
	L(){}
	L(P aa, P bb) : a(aa), b(bb){}
};

// 共役複素数 conj(a);

// 符号
int sig(D a, D b=0) { return a < b - EPS ? -1 : (a > b + EPS ? 1 : 0); }

// 内積
D dot(P a, P b) { return (conj(a)*b).real(); }

// 外積
D cross(P a, P b) { return (conj(a)*b).imag(); }

// 線分abに対する点cの位置
enum STATE{LEFT=1, RIGHT=-1, BACK=2, FRONT=-2, ON=0, IN=3, OUT=-3};
int ccw(P a, P b, P c)
{
	b -= a, c -= a;
	D s = sig(cross(b, c));
	if (s) return s>0 ? LEFT : RIGHT;
	if (sig(dot(b, c))<0) return BACK;
	if (sig(abs(c), abs(b))>0) return FRONT;
	return ON;
}

// 直線lに対する点pの写像
P projection(L l, P p)
{
	return l.a + (l.b-l.a)/abs(l.b-l.a) * dot(l.b-l.a, p-l.a)/abs(l.b-l.a);
}

// 直線lに対する点pの反射
P reflection(L l, P p)
{
	return p + (projection(l, p)-p)*P(2, 0);
}

// 直線abと点cの距離
D dLP(L l, P c)
{
	return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}

// 線分abと点cの距離
D dSP(L l, P c)
{
	if (sig(dot(l.b-l.a, c-l.a))<0) return abs(c-l.a);
	if (sig(dot(l.a-l.b, c-l.b))<0) return abs(c-l.b);
	return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}

// 線分と線分の交差判定
bool iSS(L s, L t)
{
	return (ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0)
			&& (ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0);
}

// 線分と線分の距離
D dSS(L s, L t)
{
	if (iSS(s, t)) return 0;
	return min(min(dSP(t, s.a), dSP(t, s.b)), min(dSP(s, t.a), dSP(s, t.b)));
}

// 線分と線分の交点 (公差していることが前提)
P cSS(L s, L t)
{
	D d1 = dLP(t, s.a);
	D d2 = dLP(t, s.b);
	D tmp = d1 / (d1 + d2);
	return s.a + (s.b-s.a)*tmp;
}

// 直線と直線の交差判定
bool iLL(L s, L t)
{
	return sig(cross(s.b-s.a, t.b-t.a))!=0;
}

// 直線と直線の交点 iLLを確認してから使用
P cLL(L s, L t)
{
	P ss = s.b - s.a, tt = t.b - t.a;
	return s.a + ss*cross(tt, t.a-s.a)/cross(tt, ss);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <complex>
#include <cmath>
#include <iostream>
#include <cstudio>

using namespace std;

typedef complex<double> xy_t;

double dot_product(xy_t a, xy_t b) {
  return (conj(a)*b).real();
}

double cross_product(xy_t a, xy_t b) {
  return (conj(a)*b).imag();
}

int main() {
  xy_t P[100];
  int n;

  cin >> n;
  
  for (int i = 0; i < n; i++) {
    double x, y;
    cin >> x >> y;
    P[i] = xy_t(x,y);
  }

  //center all coordinates based on first element
  for (int i = 1; i < n; i++) {
    P[i] -= P[0];
  }
  
  //calculate sum
  double sum = 0.0;
  for (int i = 1; i+1 < n ; i++) {
    xy_t  a = P[i] , b = P[i + 1];
    sum += cross_product(a, b) / 2.0;
  }

  printf("%.1f\n", abs(sum));
  
}

Compiler output:
a.cc:4:10: fatal error: cstudio: No such file or directory
    4 | #include <cstudio>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
Point X[100000];
struct Point { long double px, py; };
struct Segment { Point p1, p2; };
Point Minus(Point a, Point b) { Point G; G.px = a.px - b.px; G.py = a.py - b.py; return G; }
long double Abs(Point a) { return sqrt(a.px*a.px + a.py*a.py); }
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
long double dst(const Segment& a, const Point& b) {
	if (dot(Minus(a.p2, a.p1), Minus(b, a.p1)) < 0.0) return Abs(Minus(b, a.p1));
	if (dot(Minus(a.p1, a.p2), Minus(b, a.p2)) < 0.0) return Abs(Minus(b, a.p2));
	return abs(crs(Minus(a.p2, a.p1), Minus(b, a.p1)) / Abs(Minus(a.p2, a.p1)));
}
int main() {
	int N; cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> X[i].px >> X[i].py;
	}
	long double SUM = 0.0l;
	for (int i = 1; i < N - 1; i++) {
		Segment A; A.p1 = X[i]; A.p2 = X[i + 1];
		long double DST = dst(A, X[0]);
		Point H; H.px = X[i].px - X[i + 1].px;
		H.py = X[i].py - X[i + 1].py;
		long double LEN = Abs(H);
		SUM += DST*LEN / 2;
	}
	cout << fixed << setprecision(5141919) << SUM << endl;
	return 0;
}

Compiler output:
a.cc:5:1: error: 'Point' does not name a type
    5 | Point X[100000];
      | ^~~~~
a.cc: In function 'int main()':
a.cc:20:24: error: 'X' was not declared in this scope
   20 |                 cin >> X[i].px >> X[i].py;
      |                        ^
a.cc:24:35: error: 'X' was not declared in this scope
   24 |                 Segment A; A.p1 = X[i]; A.p2 = X[i + 1];
      |                                   ^
Language: C++

#include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
using namespace std;

int main() {
	typedef complex<int> xy;
	xy p[100];
	int x, y, n;
	double s;
	cin >> nconst;
	for ( int i = 0; i < n; i++ ) {
		cin >> x, y;
		p[i] = xy( x, y );
	}
	for ( int i = 1; i < n - 1; i++ ) {
		s += ( conj( p[i] - p[0] ) * ( p[i + 1] - p[0] ) ).imag() * 0.5;
	}
	printf( "%.1f\n", abs(s) );
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'nconst' was not declared in this scope; did you mean 'const'?
   12 |         cin >> nconst;
      |                ^~~~~~
      |                const
Language: C++

#include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
using namespace std;

int main() {
	typedef complex<double> com;
	double s = 0.0;
	int n, x0, y0, x1, y1, x2, y2;
	cin >> n >> x0 >> y0 >> x1 >> y1;
	for ( int i = 0; i < n - 2; i++ ) {
		cin >> x2 >> y2;
		s += ( conj( com( x1 - x0, y1 - y0 ) ) * com( x2 - x0, y2 - y0 ) ).imag() * 0.5;
		x1 = x2;
		y1 = y2;
	}
	printf( "%.1f\n", p );
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: 'p' was not declared in this scope
   18 |         printf( "%.1f\n", p );
      |                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
class Point{
  public:
  double x,y;
  Point(double x=0,double y=0):x(x),y(y){}
  Point operator + (Point p){return Point(x+p.x,y+p.y);}
  Point operator - (Point p){return Point(x-p.x,y-p.y);}
  Point operator * (double a){return Point(a*x,a*y);}
  Point operator / (double a){return Point(x/a,y/a);}

  bool operator < (const Point &p) const{
    return x!=p.x?x<p.x:y<p.y;
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x)<EPS&&fabs(y-p.y)<EPS;
  }
};
//?????? ????????????????????????
double cross(Point a,Point b){
  return a.x*b.y-a.y*b.x;
}
tupedef vector<Point> Polygon
double Area(Polygon p) {
  double a=0;
  for(int i=0;i<p.size();i++)a+=cross(p[i],p[(i+1)%p.size()]);
  return a/2;
}
int main(){
  int n;
  Polygon p;
  Point s;
  cin>>n;
  while(n--){
    cin>>s.x>>s.y;
    p.push_back(s);
  }
  cout<<Area(p)<<endl;
}

Compiler output:
a.cc: In member function 'bool Point::operator==(const Point&) const':
a.cc:16:24: error: 'EPS' was not declared in this scope
   16 |     return fabs(x-p.x)<EPS&&fabs(y-p.y)<EPS;
      |                        ^~~
a.cc: At global scope:
a.cc:23:1: error: 'tupedef' does not name a type; did you mean 'typedef'?
   23 | tupedef vector<Point> Polygon
      | ^~~~~~~
      | typedef
a.cc: In function 'int main()':
a.cc:31:3: error: 'Polygon' was not declared in this scope
   31 |   Polygon p;
      |   ^~~~~~~
a.cc:36:5: error: 'p' was not declared in this scope
   36 |     p.push_back(s);
      |     ^
a.cc:38:14: error: 'p' was not declared in this scope
   38 |   cout<<Area(p)<<endl;
      |              ^
a.cc:38:9: error: 'Area' was not declared in this scope
   38 |   cout<<Area(p)<<endl;
      |         ^~~~
Language: C++

#include <cstdio>
#include <complex>
using namespace std;

typedef complex<double> xy_t;

xy_t P[110];

int main(){
  int N;
  scanf("%d", &N);
  for (int i=0; i<N; i++){
    double x, y;
    scanf("%lf %lf", &x, &y)
    P[i] = xy_t(x,y);
  }
  double sum = 0.0;
  for (int i=2; i<N; ++i){
    xy_t a=P[0], b=P[i-1], c=P[i];
    sum += 0.5*((b.real()-a.real())*(c.imag()-a.imag())
		-(b.imag()-a.imag())*(c.real()-a.real()));
  }
  printf("%.6f\n", sum);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: expected ';' before 'P'
   14 |     scanf("%lf %lf", &x, &y)
      |                             ^
      |                             ;
   15 |     P[i] = xy_t(x,y);
      |     ~