static void Main(string[] args) { // Console.WriteLine(CM10.Shunting("60.8-54.23")); // Console.WriteLine(CM30.IsDouble((CM10.Shunting("60.8-54.23")).ToString())); Console.WriteLine("你是多少年级?????、"); int s1 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("你想做多少道题?????、"); int s2 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("你希望题中数的范围是多少?????、"); int s3 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("你希望做多少个运算符以内的四则运算?????、"); int s4 = Convert.ToInt32(Console.ReadLine()); CM21.IsGrades(s1, s2, s3, s4); //Fraction_Math Franction = new Fraction_Math(); //Console.Write(Franction.Add(0.7,0.6).Numerator+"/"+ Franction.Add(0.7, 0.6).Denominator); //for (int i = 0; i <= s2; i++) //{ // Console.WriteLine(CM22.DecimalAndInteger(s3)); //} //Console.WriteLine(s); Console.ReadKey(); //string s = "(" + "1" + "+" + "3" + ")" + "*" + "10"; }
static void Main(string[] args) { //Stack<double> s = new Stack<double>(); //double t = 1.1; //string st = t.ToString(); //s.Push(Convert.ToDouble( st)); //string a = "10+12-50+60×2"; //Console.WriteLine(CM10.Shunting(a)); // Involution.Generate(a, 3); // Console.WriteLine(CM30.Random_Fraction()); // Console.WriteLine(CM11.Shunting("(2+1)×2")); //Console.WriteLine(CM30.IsDouble((CM10.Shunting("60.8×54.23")).ToString())); //string s= Fraction_Math.Fraction(2.5,1.2,'/'); //Console.WriteLine(s); Console.WriteLine("你是多少年级?????、"); int s1 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("你想做多少道题?????、"); int s2 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("你希望题中数的范围是多少?????、"); int s3 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("你希望做多少个运算符以内的四则运算?????、"); int s4 = Convert.ToInt32(Console.ReadLine()); //符号配置{ "+", "-", "×", "÷" }; //calculation = new string[] { "+", "-", "×", "÷" }; //foreach (int i in Brackets.Generate("2+6-5×5", 3)) //{ // Console.WriteLine(i); //} //年级配置 CM21.IsGrades(s1, s2, s3, s4); //用户自定义 //CM22.ProblemSet(s2, s3, s4, calculation, true, true, false); //Console.WriteLine(Fraction_Math.Fraction(0.5,0.5,'+')); //for (int i = 0; i <= s2; i++) //{ // Console.WriteLine(CM22.DecimalAndInteger(s3)); //} //Console.WriteLine(s); Console.ReadKey(); //string s = "(" + "1" + "+" + "3" + ")" + "*" + "10"; }
//用户自定义 /// <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()); } }