循环:switch

1. switch循环

 

            switch (Type)
            {
                case 1:
                    if (answerCount > 1)
                    {
                        isCorrect = false;
                        remark += "单选题只能有一个答案;";
                    }
                    break;
                case 2:
                    if (answerCount < 2)
                    {
                        isCorrect = false;
                        remark += "多选题至少需要两个答案;";
                    }
                    break;
                default:
                    break;
            }        

  

posted @ 2023-11-07 15:39  小易儿  阅读(16)  评论(0编辑  收藏  举报