#include #include #include #include int main() { uint16_t operand1, operand2; char operation; std::cout << "Ââåäèòå ïåðâûé îïåðàíä (0-65535): "; std::cin >> operand1; std::cout << "Ââåäèòå îïåðàöèþ (&, |, ^): "; std::cin >> operation; std::cout << "Ââåäèòå âòîðîé îïåðàíä (0-65535): "; std::cin >> operand2; uint16_t result; switch (operation) { case '&': result = operand1 & operand2; break; case '|': result = operand1 | operand2; break; case '^': result = operand1 ^ operand2; break; default: std::cerr << "Îøèáêà: íåâåðíûé îïåðàòîð!" << std::endl; return 1; } std::cout << "Ðåçóëüòàò â øåñòíàäöàòåðè÷íîì âèäå: 0x" << std::hex << std::uppercase << result << std::endl; std::cout << "Ðåçóëüòàò â äâîè÷íîì âèäå: " << std::bitset<16>(result) << std::endl; return 0; }