5. Take a total of ten coins of one cent, two cents, and five cents, to pay eighteen cents. How many different ways are there to do this?

保留源文本的换行和格式，直接输出翻译结果如下：

5. Take a total of ten coins of one cent, two cents, and five cents, to pay eighteen cents. How many different ways are there to do this?
5. Solution: Let $x, y, z$ represent the number of 1-cent, 2-cent, and 5-cent coins, respectively. Therefore, we have the following equations:
$$\begin{array}{l}
x+2 y+5 z=18 \\
x+y+z=10
\end{array}$$

Subtracting the second equation from the first, we get $y+4 z=8$.
We need to find the non-negative integer solutions to the above equations. First, solve
$$u+4 v=1$$

Since $4=3+1$, we get $1=-3+4$. Therefore, $u=-3, v=1$ is a set of integer solutions to $u+4 v=1$. Thus,
$$y=8 \times(-3)=-24, z=8 \times 1=8$$

is a set of integer solutions to $y+4 z=8$. The complete set of integer solutions is
$$y=-24-4 t, \quad z=8+t, \quad t=0, \pm 1, \pm 2, \cdots$$

Therefore,
$$x=10-y-z=26+3 t$$

According to the problem, we need $x \geqslant 0, y \geqslant 0, z \geqslant 0$. From $x=26+3 t \geqslant 0$, we get $t \geqslant-\frac{26}{3}$; from $y=-24-4 t \geqslant 0$, we get $t \leqslant-6$; and from $z=8+t \geqslant 0$, we get $t \geqslant-8$. Therefore, $-8 \leqslant t \leqslant-6$ (taking $t=-8, -7, -6$) corresponds to the following three sets of solutions:
$$\left\{\begin{array} { l } 
{ x = 2 } \\
{ y = 8 } \\
{ z = 0 , }
\end{array} \quad \left\{\begin{array}{l}
x=5 \\
y=4 \\
z=1
\end{array},\left\{\begin{array}{l}
x=8 \\
y=0 \\
z=2
\end{array}\right.\right.\right.$$

Therefore, there are three different ways to take the coins, which are the three sets of solutions above.