我试过搜索它,但我现在真的不知道如何正确地提出问题......
我有if-statement
许多逻辑运算符。我如何更容易做到这一点?
If (n == 1 ||n == 2 ||n == 3 ||n == 5 ||n == 9 ||n == 8 ||n == 7 ||n == 551 ||n == 17 ||n == 81 || etc etc)
{ //Stuff
}
我在用伪代码思考我想要这样的东西:
List list = {1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, or 36 }
if n is in list, then {}
如您所知,我是初学者,在制定所需内容时遇到问题。