12.118 Find all prime numbers \( p, q \) and \( r \) that satisfy the equation \( p^{q} + q^{p} = r \). (53rd Moscow Mathematical Olympiad, 1990)
[Solution] Without loss of generality, let $\quad p<q$.
Obviously, if $r$ is a prime number, then $p$ and $q$ cannot both be odd primes, otherwise $r$ would have to be $r=2$. In this case, the equation cannot hold.
Therefore, $p$ and $q$ must be one even prime and one odd prime.
By $p<q$ we get
$$
p=2 \text {. }
$$

When $q \geqslant 5$,
$$
\begin{aligned}
2^{q}+q^{2} & =\left(2^{q}+1\right)+\left(q^{2}-1\right) \\
& =3\left(2^{q-1}-2^{q-2}+\cdots+1\right)+\left(q^{2}-1\right) .
\end{aligned}
$$

Since $3 \mid q^{2}-1$, then
$$
3 \mid 2^{q}+q^{2},
$$

thus $r$ is a multiple of 3, which is impossible.
Therefore, we can only have
$$
q=3 .
$$

In this case, $\quad p^{q}+q^{p}=2^{3}+3^{2}=17$ is a prime number.
Therefore, when $p<q$, there is only one set of prime solutions:
$$
p=2, q=3, r=17 .
$$

Similarly, when $q<p$, there is also only one set of prime solutions:
$$
q=2, p=3, r=17 \text {. }
$$