3. Given a right-angled triangle with the two legs $a, b$ $(a \leqslant b)$ and the hypotenuse $c$ all being integers, and the radius of its inscribed circle $r=3$. Then the number of such right-angled triangles is ( ).
(A) 0
(B) 1
(C) 3
(D) infinitely many
3. C.

From $a+b-c=2 r=6$, we get
$$
a^{2}+b^{2}=c^{2}=(a+b-6)^{2} \text {. }
$$

Rearranging gives $(a-6)(b-6)=18$.
It is clear that $a$ and $b$ are both positive integers greater than 6. Thus,
$$
(a-6, b-6)=(1,18),(2,9),(3,6) \text {. }
$$

Solving gives
$$
(a, b, c)=(7,24,25),(8,15,17),(9,12,15) \text {. }
$$

Therefore, there are three right-angled triangles that satisfy the conditions.