#include <iostream> #include <cstdint> // Declare enum class PinState with underlying type uint8_t // Values: Low, High enum PinState{ Low, High }; const char* toString(PinState s){ char *sb; if(s == 0) sb = "LOW"; else sb = "HIGH"; return sb; } int main() { int x; std::cin >> x; // x is guaranteed to be 0 or 1 PinState s = (x == 0) ? PinState::Low : PinState::High; std::cout << toString(s); return 0; }
Test Cases
Test Results
Input
0
Expected Output
LOW