4. Divide a wire of length $11 \mathrm{~cm}$ into several segments of integer centimeters, such that any three segments can form the sides of a triangle. Then the number of different ways to divide the wire is $\qquad$ (ways with the same number of segments and corresponding equal lengths are considered the same way).
4.8.

Let the shortest two segments be $a \mathrm{~cm}, b \mathrm{~cm}$, and take any other segment $c \mathrm{~cm} (a \leqslant b \leqslant c)$. Then $b \leqslant c < a + b$.
(1) If $a = 1$, then $1 \leqslant b \leqslant c < b + 1$. Thus, $b = c$. Therefore, $b \in (11 - 1), 2b < 11 - 1$. Hence, $b$ can be $1, 2, 5$, giving three ways to divide.
(2) If $a = 2$, then $2 \leqslant b \leqslant c < b + 2$. Thus, $c$ can be $b$ or $b + 1$. Let the segments of length $b \mathrm{~cm}$ and $(b + 1) \mathrm{~cm}$ (excluding the segment of length $a$) be $x$ and $y$ segments respectively, where $x \geqslant 0$, $y \geqslant 0$, and $x + y \geqslant 2$.
By the problem, $2 + bx + (b + 1)y = 11$.
Then $y = \frac{9 + x}{b + 1} - x$.
When $x = 0$, $y = \frac{9}{b + 1}$, so $b + 1$ can only be 3, giving one way to divide $(2, 3, 3, 3)$;

When $x = 1$, $y = \frac{10}{b + 1} - 1$, so $b + 1$ can only be 5, giving one way to divide $(2, 4, 5)$;
When $x = 2$, it does not meet the problem's conditions;
When $x = 3$, $y = \frac{12}{b + 1} - 3$, so $b + 1 = 3, 4$, giving two ways to divide $(2, 2, 2, 2, 3), (2, 3, 3, 3)$;

When $x \geqslant 4$, $bx \leqslant 9 \Rightarrow b \leqslant \frac{9}{x} \leqslant \frac{9}{4} < 3$, thus $b = 2$, then $2 + 2x + 3y = 11$, solving gives
$$
(x, y) = (3, 1), (0, 3),
$$

giving two ways to divide $(2, 2, 2, 2, 3), (2, 3, 3, 3)$.
(3) If $a \geqslant 3$, then $a + b + c \geqslant 9, 2a + b + c \geqslant 12$. Therefore, the wire can only be divided into 3 segments. Thus, $(a, b, c) = (3, 3, 5), (3, 4, 4)$, giving two ways to divide.
In summary, there are 8 ways to divide in total.