0405.cpp (156B)
1 class Solution { 2 public: 3 string toHex(int num) const { 4 std::stringstream ss; 5 ss << std::hex << num; 6 return ss.str(); 7 } 8 };