There is a <cmath> function for computing the length of the hypotenuse.
http://www.cplusplus.com/reference/cmath/hypot/
For doing numeric type to string conversions, C++11 supports std::to_string, but without C++11 you could still do your stringstream method with a templated function (since the function body is exactly the same regardless of the argument type).