4. Given 100 lines on a plane, let $T$ denote the set of right-angled triangles formed by some three of these lines. Find the maximum value of $|T|$. (Supplied by Zou Jin)
4. $|T|_{\max }=62500$.

First, prove that the number of right-angled triangles does not exceed 62500. Take any line, and denote the set of all lines parallel to it as $A_{1}$ (including this line itself), and the set of all lines perpendicular to it as $B_{1}$ (if no lines are perpendicular to it, then $B_{1}=\varnothing$).

Then, from the remaining lines, take any one and denote the set of all lines parallel to it as $A_{2}$, and the set of all lines perpendicular to it as $B_{2}$.
Consider the remaining lines, and similarly define $A_{3}, B_{3}, \cdots$.
Thus, these 100 lines are divided into disjoint sets $A_{1}, B_{1}, A_{2}, B_{2}, \cdots, A_{k}, B_{k}$.
Let $\left|A_{i}\right|=a_{i},\left|B_{i}\right|=b_{i}(1 \leqslant i \leqslant k)$. Then
$$
\sum_{i=1}^{k}\left(a_{i}+b_{i}\right)=100 .
$$

Note that, each right-angled triangle must have one pair of perpendicular lines and another line that is neither parallel nor perpendicular to the first pair.
Therefore, the total number of right-angled triangles does not exceed
$$
\begin{array}{l}
\sum_{i=1}^{k} a_{i} b_{i}\left(100-a_{i}-b_{i}\right) \\
\leqslant \sum_{i=1}^{k} \frac{\left(a_{i}+b_{i}\right)^{2}}{4}\left(100-a_{i}-b_{i}\right) \\
=\frac{1}{4} \sum_{i=1}^{k}\left(a_{i}+b_{i}\right)\left[\left(a_{i}+b_{i}\right)\left(100-a_{i}-b_{i}\right)\right] \\
\leqslant \frac{1}{4} \sum_{i=1}^{k}\left(a_{i}+b_{i}\right) \frac{\left[\left(a_{i}+b_{i}\right)+\left(100-a_{i}-b_{i}\right)\right]^{2}}{4} \\
=625 \sum_{i=1}^{k}\left(a_{i}+b_{i}\right)=62500 .
\end{array}
$$

Next, provide a construction for 62500 right-angled triangles.
In the coordinate plane, take 100 lines as follows:
$$
\begin{array}{l}
x=1, x=2, \cdots, x=25 ; \\
y=1, y=2, \cdots, y=25 ; \\
y=x+26, y=x+27, \cdots, y=x+50 ; \\
y=-x+101, y=-x+102, \cdots, y=-x+125 .
\end{array}
$$

At this point, these 100 lines are divided into four groups, each containing 25 parallel lines, with inclinations of $0^{\circ} 、 45^{\circ} 、 90^{\circ}$, and $135^{\circ}$, respectively.

It is easy to see that the first two groups of lines are perpendicular to each other, and the last two groups of lines are also perpendicular to each other, and no three lines intersect at the same point.
Thus, the total number of right-angled triangles is
$$
25 \times 25 \times 50+25 \times 25 \times 50=62500 \text {. }
$$

In conclusion, the maximum value sought is 62500.