C# switch case 或操作

参考地址

栗子如下

            int a = 3; //为1或者2的时候,可以打印出来
            switch (a)
            {
                case 1:
                case 2:
                    {
                        Console.WriteLine(a);
                        break;
                    }
            }
posted @ 2020-06-16 13:43  Alex_Mercer  阅读(220)  评论(0编辑  收藏  举报