#include <iostream>
#include <iomanip>
#include <sstream>
int main()
{
int x, y;
std::stringstream stream;
std::cin >> x;
stream << x;
stream >> std::hex >> y;
std::cout << y;
return 0;
}
More Related Contents:
- Integer to hex string in C++
- Decimal to hex conversion c++ built-in function
- How do you convert decimal in integer to hexadecimal in integer? [closed]
- Program to find sum of prime numbers between 1 and 10^7
- Algorithm (especially for c++) to show Every Permutation
- Random generation of numbers? [closed]
- Which is the fastest algorithm to find prime numbers?
- What is the fastest way to transpose a matrix in C++?
- Rounding up to the nearest multiple of a number
- Why will std::sort crash if the comparison function is not as operator
- Magic number in boost::hash_combine
- Creating all possible k combinations of n items in C++
- How do I calculate the week number given a date?
- Where can I get a “useful” C++ binary search algorithm?
- Why use hex?
- Printing prime numbers from 1 through 100
- Circular lock-free buffer
- C++ – Decimal to binary converting
- What is the underlying type of a c++ enum?
- Generating m distinct random numbers in the range [0..n-1]
- Special simple random number generator
- Efficiently getting all divisors of a given number
- How can std::make_heap be implemented while making at most 3N comparisons?
- What is the right approach when using STL container for median calculation?
- Howto create combinations of several vectors without hardcoding loops in C++?
- Removing ‘#include ‘ doesn’t break the code
- Is it more efficient to copy a vector by reserving and copying, or by creating and swapping? [duplicate]
- Why there is no std::copy_if algorithm?
- How to convert decimal fractions to hexadecimal fractions?
- How can I test whether a number is a power of 2?