5. If a pair of different natural numbers $a, b$ satisfies that their arithmetic mean $A=\frac{a+b}{2}$ and geometric mean $G=\sqrt{a b}$ are both two-digit numbers, and one of $A$ and $G$ can be obtained by swapping the tens and units digits of the other, then such a pair of natural numbers is called a "good pair". How many good pairs satisfy the condition? ( )
(A) 1
(B) 2
(C) 3
(D) 4
5.A.

From the problem, we have $\left\{\begin{array}{l}a+b=2 A, \\ a b=G^{2} .\end{array}\right.$
Then $a, b$ are the roots of the quadratic equation $x^{2}-$ $2 A x+G^{2}=0$.
Solving for $a, b$ gives $a, b=A \pm \sqrt{A^{2}-G^{2}}$.
Thus, $\sqrt{A^{2}-G^{2}}$ must be a natural number.
Let $A=10 p+q(1 \leqslant p, q \leqslant 9)$, then $G=10 q+p$.
$A^{2}-G^{2}=(A+G)(A-G)$
$=9 \times 11(p+q)(p-q)$.
For $A^{2}-G^{2}$ to be a perfect square, it must be that
$11 \mid(p+q)$ or $11 \mid(p-q)$.
However, $1 \leqslant p-q \leqslant 8$, so $11 \nmid(p-q)$. Therefore,
$11 \mid(p+q)$.
Since $p+q \leqslant 9+8=17$, it follows that $p+q=11$.
This requires $p-q$ to be a perfect square, and since $p-q \leqslant 8 < 3^{2}$, the possible values are
$p-q=2^{2}=4$ or $p-q=1^{2}=1$.
When $p-q=4, p+q=11$, $p$ and $q$ are not integers, so $p-q \neq 4$.

When $p-q=1, p+q=11$, we get $p=6, q=5$, so $A$ and $G$ are 65 and 56, respectively.
Thus, $(a, b)$ is $(98,32)$.
Therefore, there is only 1 pair of good numbers that satisfies the condition.