#include #include #include enum class RPS{ rock=0, scissors=1, paper=2 }; enum class RPSResult{ Won=0, Drew=1, Lost=2 }; int main(){ int in1,in2; RPS mine,yours; std::cin >> in1 >> in2; mine=static_cast(in1); yours=static_cast(in2); RPSResult res=RPSResult::Won; switch(mine){ case RPS::rock: switch(yours){ case RPS::rock: res = RPSResult::Drew; break; case RPS::scissors: res = RPSResult::Won; break; case RPS::paper: res = RPSResult::Lost; break; } case RPS::scissors: switch(yours){ case RPS::rock: res = RPSResult::Lost; break; case RPS::scissors: res = RPSResult::Drew; break; case RPS::paper: res = RPSResult::Won; break; } case RPS::paper: switch(yours){ case RPS::rock: res = RPSResult::Won; break; case RPS::scissors: res = RPSResult::Lost; break; case RPS::paper: res = RPSResult::Drew; break; } } switch(res){ case RPSResult::Won: std::cout << "Won" << std::endl; break; case RPSResult::Drew: std::cout << "Drew" << std::endl; break; case RPSResult::Lost: std::cout << "Lost" << std::endl; break; } return 0; }