On Earth we have \begin{eqnarray*}\sigma & = & 5.67 \times 10^{-8} W m^{-2} K^{-4}\\ e & =&0.605\\ a&=&3.1\\ S& = &342 W m^{-2}.\end{eqnarray*} The energy balance model now gives the following estimate for the average temperature on Earth: \begin{eqnarray*} T & = & \left(\frac{(1-0.31)342Wm^{-2}}{5.67\times 10^{-8}Wm^{-2}K^{-4} \times 0.605}\right)^{1/4}\\ & = & \left(6879181424.63\right)^{1/4} K\\ & \approx & 288K.\end{eqnarray*} Note that this temperature is measured in Kelvin. It corresponds to around $15$ degrees centigrade. This is spot on the measured value given by NASA. A similar calculation for the Moon (taking $e=1$) gives a value of around $-19$ degrees centigrade. It's important to note that this is an average estimate. In practice the Moon's temperature can vary quite widely (between boiling and freezing) because the Moon rotates every 27 days and hence the sunlit periods of on the Moon can last much longer than on the Earth (as long as 13 days) leading to variations between $123$ degrees centigrade to $-153$ degrees centigrade, with an average of -$19$ degrees centigrade, which is what we found above.