fork(16) download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4.  
  5. int main() {
  6. int x = 10; // equivalents to 0x0A
  7. int y = 0x0A; // equivalents to 10
  8.  
  9. std::cout << std::setw(2) << std::setfill('0')
  10. << "x = " << std::hex << "0x" << x << std::endl;
  11. std::cout << "y = " << std::dec << y << std::endl;
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
x = 0xa
y = 10