With TikZ you can create a macro for this purpose. For example:
\documentclass{article}
\usepackage {tikz}
\newcommand{\mysol}[1]
{% <-- We don't need a space here
\begin{tikzpicture}[baseline=(a.base),line width=0.1ex]
\node[inner sep=0] (a) at (0,0) {$#1$};
\draw (a.south west) -- ([xshift=1.5ex]a.south east);
\foreach\i in {0,0.5}
\draw ([xshift=\i ex,yshift=-0.5ex]a.south east) --++ (1ex,1ex);
\end{tikzpicture}% <-- We don't need a space here either
}
\begin{document}
\textbf{Problem.} The bottom of a ladder must be placed $3$ feet from a wall. The ladder is $12$ feet long. How far above the ground does the ladder touch the wall?
\bigskip
\textbf{Solution.} By the Pythagorean Theorem,
\[a^2=b^2+c^2\Longrightarrow b=\sqrt{a^2-b^2}=\sqrt{12^2-3^2}=\sqrt{135}=\mysol{3\sqrt{15}}.\]
So the ladder touches the wall \mysol{3\sqrt{15}} feet above the ground.
\end{document}
Note that if the solution will not be in math mode you must remove the $...$
inside the node in the macro.

\underline
macro? A comment up front:\underline
does not add the two slashes. How important are these slashes?