fork download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int decimal = 100;
  8. stringstream tmp;
  9. tmp << std::hex << decimal;
  10. string hstr = tmp.str();
  11. std::cout << "10 = " << decimal << " 16 = " << hstr << std::endl;
  12.  
  13.  
  14. return 0;
  15. }
  16.  
  17.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
10 = 100 16 = 64