Exemplo n.º 1
0
        //用户自定义
        /// <summary>
        ///
        /// </summary>
        /// <param name="exercises">题目数量</param>
        /// <param name="range">数据范围</param>
        /// <param name="operators">符号数量</param>
        /// <param name="operatorClass">符号种类</param>
        /// <param name="isFraction">是否支持真分数运算</param>
        /// <param name="isDecimal">是否支持小数运算</param>
        /// <param name="isInvolution">是否支持乘方运算</param>
        public static void ProblemSet(int exercises, int range, int operators, string[] operatorClass, bool isFraction, bool isDecimal, bool isInvolution)
        {
            List <string> Expression = new List <string>();
            List <string> Answer     = new List <string>();
            int           Rannum     = l.Next(1, 3);

            if (isFraction && Rannum == 1)//带分数
            {
                CM30.OpNumber(range, exercises, operators, operatorClass, true, true, false, ref Expression, ref Answer);
                CM21.Injection(Expression.ToArray(), Answer.ToArray());
            }
            else//带小数
            {
                CM30.OpNumber(range, exercises, operators, operatorClass, false, true, false, ref Expression, ref Answer);
                CM21.Injection(Expression.ToArray(), Answer.ToArray());
            }
        }
Exemplo n.º 2
0
        //年级配置
        /// <summary>
        ///
        /// </summary>
        /// <param name="grades">年级</param>
        /// <param name="exercises">题目数量</param>
        /// <param name="range">范围</param>
        /// <param name="Operators">符号</param>
        public static void IsGrades(int grades, int exercises, int range, int Operators)
        {
            List <string> Expression = new List <string>();
            List <string> Answer     = new List <string>();

            switch (grades)
            {
            case 1:
                calculation = new string[] { "+", "-" };
                CM30.OpNumber(range, exercises, Operators, calculation, false, false, false, ref Expression, ref Answer);
                Injection(Expression.ToArray(), Answer.ToArray());
                break;

            case 2:
                CM30.OpNumber(range, exercises, Operators, calculation, false, false, false, ref Expression, ref Answer);
                Injection(Expression.ToArray(), Answer.ToArray());
                break;

            case 3:
                CM30.OpNumber(range, exercises, Operators, calculation, true, false, false, ref Expression, ref Answer);
                Injection(Expression.ToArray(), Answer.ToArray());
                break;

            case 4:
                CM30.OpNumber(range, exercises, Operators, calculation, true, true, false, ref Expression, ref Answer);
                Injection(Expression.ToArray(), Answer.ToArray());
                break;

            case 5:
                CM30.OpNumber(range, exercises, Operators, calculation, true, true, false, ref Expression, ref Answer);
                Injection(Expression.ToArray(), Answer.ToArray());
                break;

            case 6:
                CM30.OpNumber(range, exercises, Operators, calculation, true, true, true, ref Expression, ref Answer);
                Injection(Expression.ToArray(), Answer.ToArray());
                break;

            default: break;
            }
        }
Exemplo n.º 3
0
        public static void IsGrades(int grades, int exercises, int range, int Operators)
        {
            string[] Expression = new string[exercises];
            string[] Answer     = new string[exercises];
            switch (grades)
            {
            case 1:
                CM30.OpNumber(range, exercises, Operators, 2, false, ref Expression, ref Answer);
                Injection(Expression, Answer);
                break;

            case 2:
                CM30.OpNumber(range, exercises, Operators, 4, false, ref Expression, ref Answer);
                Injection(Expression, Answer);
                break;

            case 3:
                CM30.OpNumber(range, exercises, Operators, 4, false, ref Expression, ref Answer);
                Injection(Expression, Answer);
                break;

            case 4:
                CM30.OpNumber(range, exercises, Operators, 4, true, ref Expression, ref Answer);
                Injection(Expression, Answer);
                break;

            case 5:
                CM30.OpNumber(range, exercises, Operators, 4, true, ref Expression, ref Answer);
                Injection(Expression, Answer);
                break;

            case 6:
                CM30.OpNumber(range, exercises, Operators, 4, true, ref Expression, ref Answer);
                Injection(Expression, Answer);
                break;

            default: break;
            }
        }