We have
[tex]\begin{cases}x+y=16\\x^2+y^2=160\end{cases}[/tex]
From the first equation, we deduce [tex]y=16-x[/tex]
Plug this in the second equation to get
[tex]x^2+(16-x)^2=160 \iff x^2+(256-32x+x^2)=160 \iff 2x^2-32x+96=0[/tex]
We can divide both sides by 2 to get
[tex]x^2-16x+48=0[/tex]
Use the quadratic formula to solve this equation, and you'll have the solutions 4 and 12.
So, if x=4, y must be 12, so that their sum is 16.
Similarly, if x=12, y must be 4.
The two numbers are 4 and 12.