Can this if statement be simplified?

前端 未结 0 380
情话喂你
情话喂你 2020-12-07 11:04

I need to make sure that a pair of numbers is either (1, 2) or (2, 1). Both x and y are always positive. The code I am using right now:

if ((x == 2 &&         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题