is surplus just an approximation?
Your second answer is correct. The problem your first approach has, is that you assume that you may only buy a discrete amount of goods. However, your demand curve is continuous and the usual assumption in microeconomics is that you can consume any amount of this good, for instance $1.478926574$ units. Thus, your first calculation for the surplus is not correct, the correct way to do it is

$$CS = \int_{5}^{10} (10-p) \mathcal{d}p = 10p-\dfrac{p^{2}}{2}|^{10}_{5} = 100-50-50+12.5=12.5$$

This result is equal to the second calculation of yours simply by the fact that it is a triangle. If demand wouldn't be linear, you'd have to use the integral form to calculate CS.