Language: C++

#include<iostream>
using namespace std;
class Point {
public:
	long double px, py;
	Point() : px(0), py(0) {};
	Point(long double px_, long double py_) : px(px_), py(py_) {};
	bool operator==(const Point& p) const { return px == p.px && py == p.py; }
	bool operator!=(const Point& p) const { return px != p.px || py != p.py; }
	bool operator<(const Point& p) const { return px < p.px ? true : (px == p.px && py < p.py); }
	bool operator>(const Point& p) const { return px > p.px ? true : (px == p.px && py > p.py); }
	bool operator<=(const Point& p) const { return !(Point(px, py) > p); }
	bool operator>=(const Point& p) const { return !(Point(px, py) < p); }
	Point operator+(const Point& p) const { return Point(px + p.px, py + p.py); }
	Point operator-(const Point& p) const { return Point(px - p.px, py - p.py); }
	Point operator/(long double d) const { return Point(px / d, py / d); }
	friend Point operator*(const Point p, long double d) { return Point(p.px * d, p.py * d); }
	friend Point operator*(long double d, const Point& p) { return p * d; }
	Point& operator+=(const Point& p1) { px += p1.px, py += p1.py; return *this; }
	Point& operator-=(const Point& p1) { px -= p1.px, py -= p1.py; return *this; }
	Point& operator*=(long double d) { px *= d, py *= d; return *this; }
	Point& operator/=(long double d) { px /= d, py /= d; return *this; }
};
struct Line { Point p1, p2; };
long double norm(const Point& a) { return a.px * a.px + a.py * a.py; }
long double abs(const Point& a) { return sqrtl(norm(a)); }
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; }
int ccw(const Point& p0, const Point& p1, const Point& p2) {
	Point a = p1 - p0, b = p2 - p0;
	if (crs(a, b) > 1e-10) return 1;
	if (crs(a, b) < -1e-10) return -1;
	if (dot(a, b) < -1e-10) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
Point crp(Line a, Line b) {
	Point c = b.p2 - b.p1;
	long double d1 = abs(crs(c, a.p1 - b.p1));
	long double d2 = abs(crs(c, a.p2 - b.p1));
	return a.p1 + (a.p2 - a.p1) * (d1 / (d1 + d2));
}
bool its(const Point& p1, const Point& p2, const Point& p3, const Point& p4) {
	bool E = (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 && ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
	if (E == false)return false;
	Point F = crp(Line{ p1,p2 }, Line{ p3,p4 });
	if (F.px <= -99.9999l || F.px >= 99.9999l)return false;
	if (F.py <= -99.9999l || F.py >= 99.9999l)return false;
	return true;
}
Point W[100], X[100]; int n;
int main() {
	while (true) {
		cin >> n; int cnt = 0; if (n == 0)break;
		for (int i = 0; i < n; i++) {
			cin >> W[i].px >> W[i].py >> X[i].px >> X[i].py;
		}
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (its(W[i], X[i], W[j], X[j]) == true)cnt++;
			}
		}
		cout << 1 + n + cnt << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'long double abs(const Point&)':
a.cc:26:42: error: 'sqrtl' was not declared in this scope; did you mean 'strtol'?
   26 | long double abs(const Point& a) { return sqrtl(norm(a)); }
      |                                          ^~~~~
      |                                          strtol