Language: C++

#include <iostream>
#include <vector>

using namespace std;


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

//??????????????????????????????
class Point{

public:

	double x, y;//??§?¨????????????????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 * (Point p) {
		return Point(x * p.x, y * p.y);
	}

	Point operator / (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) const {
		return fabs(x - p.x) < EPS &&  fabs(y - p.y) < EPS;
	}

};

typedef Point Vector;

struct Segment {
	Point p1, p2;
};

typedef Segment Line;


typedef vector<Point> Polygon;

//??????????????????????????????
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 isOrthogonal(Point a1, Point a2, Point b1, Point b2) {
	return isOrthogonal(a1 - a2, b1 - b2);
}

//???????????´?????????
bool isOrthogonal(Segment s1, Segment s2) {
	return equals(dot(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}

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

//??????????§??????¨???????????????????????????
bool isParallel(Point a1, Point a2, Point b1, Point b2) {
	return isParallel(a1 - a2, b1 - b2);
}

//?????????????????????
bool isParallel(Segment s1, Segment s2) {
	return equals(cross(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}





//???
class Circle {
public:
	Point c;//??????
	double r;//??????
	Circle(Point c = Point(), double r = 0.0) :c(c), r(r) {}
};






int main(void)
{
	int n;

	Point p[4];

	cin >> n;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 4; j++) {
			cin >> p[j].x >> p[j].y;
		}

		if (isOrthogonal(p[0], p[1], p[2], p[3])) {
			cout << 1 << endl;
		}
		else if (isParallel(p[0], p[1], p[2], p[3])) {
			cout << 2 << endl;
		}
		else {
			cout << 0 << endl;
		}

	}

	return 0;
}

Compiler output:
a.cc: In member function 'double Point::abs()':
a.cc:41:24: error: 'sqrt' was not declared in this scope
   41 |                 return sqrt(norm());
      |                        ^~~~
a.cc: In member function 'bool Point::operator==(const Point&) const':
a.cc:49:24: error: 'fabs' was not declared in this scope; did you mean 'abs'?
   49 |                 return fabs(x - p.x) < EPS &&  fabs(y - p.y) < EPS;
      |                        ^~~~
      |                        abs
a.cc: In function 'bool isOrthogonal(Vector, Vector)':
a.cc:8:22: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    8 | #define equals(a,b) (fabs((a) - (b)) < EPS) //?????????????????????????????????
      |                      ^~~~
a.cc:77:16: note: in expansion of macro 'equals'
   77 |         return equals(dot(a, b), 0.0);
      |                ^~~~~~
a.cc: In function 'bool isOrthogonal(Segment, Segment)':
a.cc:8:22: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    8 | #define equals(a,b) (fabs((a) - (b)) < EPS) //?????????????????????????????????
      |                      ^~~~
a.cc:87:16: note: in expansion of macro 'equals'
   87 |         return equals(dot(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
      |                ^~~~~~
a.cc: In function 'bool isParallel(Vector, Vector)':
a.cc:8:22: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    8 | #define equals(a,b) (fabs((a) - (b)) < EPS) //?????????????????????????????????
      |                      ^~~~
a.cc:92:16: note: in expansion of macro 'equals'
   92 |         return equals(cross(a, b), 0.0);
      |                ^~~~~~
a.cc: In function 'bool isParallel(Segment, Segment)':
a.cc:8:22: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    8 | #define equals(a,b) (fabs((a) - (b)) < EPS) //?????????????????????????????????
      |                      ^~~~
a.cc:102:16: note: in expansion of macro 'equals'
  102 |         return equals(cross(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
      |                ^~~~~~