Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
dhar1
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> using namespace std; int main() { using type = unsigned short; // B00F + 25B0 to get D5BF type left = 0xB00F; type right = 0x25B0; type first = ((left & 0xF000) >> 12) + ((right & 0xF000) >> 12); cout << "first value " << std::hex << first << std::endl; type second = ((left & 0x0F00) >> 8) + ((right & 0x0F00) >> 8); cout << "second value " << std::hex << second << std::endl; type third = ((left & 0x00F0) >> 4) + ((right & 0x00F0) >> 4); cout << "third value " << std::hex << third << std::endl; type fourth = (left & 0x000F) + (right & 0x000F); cout << "4th value " << std::hex << fourth << std::endl; type total = (first << 12) + (second << 8) + (third << 4) + fourth; cout << "total " << std::hex << total << std::endl; }
run
|
edit
|
history
|
help
0
hangman
javascritp
Attribute of qi parsers
3 sayinin toplami
constexpr internal error
Wide string to lowercase
Hangman
C++ Macro overload
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
hangman