4. A point whose both x-coordinate and y-coordinate are integers is called an integer point. If the number of integer points (including the boundary) within the triangle formed by the line $y=-2 x+k$ (where $k$ is a positive integer) and the coordinate axes is 100, then $k$ equals ( ).
(A) 9
(B) 11
(C) 18
(D) 22
4.C.
(1) $k$ is an even number. Let $k=$ $2 m$. As shown in Figure 2, $x=0, y=$
$$
\begin{array}{l}
2 m ; x=1, y=-2 \times 1 \\
+2 m ; \cdots ; x=m-1, y= \\
-2(m-1)+2 m .
\end{array}
$$

There are $m+1$ integer points on the $x$-axis. Therefore, the total number of integer point coordinates is
$$
\begin{array}{l}
-2(1+2+\cdots+m-1)+2 m(m-1)+2 m+m+1 \\
=-m(m-1)+2 m(m-1)+3 m+1 \\
=m^{2}+2 m+1 . \\
\because m^{2}+2 m+1=100, \\
\therefore m=9 \text { or } m=-11 .
\end{array}
$$
(2) $k$ is an odd number. Let $k=2 m+1$. Similarly to (1), the total number of integer point coordinates is $m^{2}+3 m+2$.
When $m^{2}+3 m+2=100$, $m$ has no integer solutions.