18. It is known that hexadecimal numbers are composed of the digits $0 \sim 9$ and the letters $\mathrm{A}$ to $\mathrm{F}$, where $\mathrm{A}, \mathrm{B}, \cdots, \mathrm{F}$ represent $10,11, \cdots, 15$ respectively. Among the first 1000 positive integers, find all hexadecimal numbers that are represented using only digits. Determine the number of these numbers, $n$, and the sum of the digits of $n$ is ( ).
(A) 17
(B) 18
(C) 19
(D) 20
(E) 21
18. E.

Notice that the hexadecimal representation of 1000 is (3E8)16. The number we are looking for is less than 1000 and is a hexadecimal number $(a b c)_{16}$, where $a$ can be $0, 1, 2, 3; b$ can be $0 \sim 9; c$ can also be $0 \sim 9$, resulting in a total of 400 numbers. However, $0=(000)_{16}$ is not a positive integer, so it is excluded.
Thus, $n=399$.
Therefore, the answer is $3+9+9=21$.