@@ -91,11 +91,12 @@ namespace SolveAvdoshin
9191 enum ExecutionMode { Interactive, CommandLine, NoEquation, };
9292
9393 static bool ProcessCommandLineArgs(string[] args, out ExecutionMode? mode, out int a, out int b,
94− out int[] coefs, out int n)
94+ out int[] coefs, out int n, out bool minOps)
9595 {
9696 coefs = new int[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, };
9797 mode = null;
9898 a = b = n = -1;
99+ minOps = false;
99100
100101 for(int i = 0; i < args.Length; i++) {
101102 switch(args[i]) {
@@ -176,6 +177,14 @@ namespace SolveAvdoshin
176177 i += 1;
177178
178179 break;
180+
181+ case "-mo":
182+ if(minOps)
183+ return false;
184+
185+ minOps = true;
186+
187+ break;
179188
180189 default:
181190 int tmp;
@@ -193,10 +202,9 @@ namespace SolveAvdoshin
193202 return mode != null;
194203 }
195204
196− static void PrintAnswers(int n, int a, int b)
205+ static void PrintAnswers(int n, int a, int b, bool minOps)
197206 {
198207 var functions = new Action<int>[] {
199− BooleanFunctions.PrintMinimaInAvdoshinBases,
200208 BooleanFunctions.PrintDerivatives,
201209 BooleanFunctions.PrintExpressionsForDerivatives,
202210 BooleanFunctions.Print2DirectionalDerivatives,
@@ -214,8 +222,14 @@ namespace SolveAvdoshin
214222 a = Math.Max(a, 3);
215223 b = Math.Max(b, 3);
216224
217− for(int i = a; i <= b; i++) {
218− Console.WriteLine("\n{0}", i ==3 ? "2-3." : i + ".\n");
225+ if(a <= 3) {
226+ Console.WriteLine("\n2-3.\n");
227+
228+ BooleanFunctions.PrintMinimaInAvdoshinBases(n, minOps);
229+ }
230+
231+ for(int i = a + 1; i <= b; i++) {
232+ Console.WriteLine("\n" + i + ".\n");
219233
220234 functions[i - 3](n);
221235 }
@@ -228,8 +242,9 @@ namespace SolveAvdoshin
228242 ExecutionMode? mode;
229243 int a, b;
230244 int n;
245+ bool minOps;
231246
232− if(ProcessCommandLineArgs(args, out mode, out a, out b, out coefs, out n)) {
247+ if(ProcessCommandLineArgs(args, out mode, out a, out b, out coefs, out n, out minOps)) {
233248 switch(mode) {
234249 case ExecutionMode.Interactive:
235250 coefs = ConsoleInput();
@@ -249,11 +264,11 @@ namespace SolveAvdoshin
249264 }
250265
251266 if(a == -1 && b == -1)
252− PrintAnswers(n, 3, 15);
267+ PrintAnswers(n, 3, 15, minOps);
253268 else if(a != -1 && b == -1)
254− PrintAnswers(n, a, a);
269+ PrintAnswers(n, a, a, minOps);
255270 else
256− PrintAnswers(n, a, b);
271+ PrintAnswers(n, a, b, minOps);
257272
258273 Console.WriteLine();
259274 }
@@ -266,20 +281,9 @@ namespace SolveAvdoshin
266281 "\n" +
267282 "\t-ex <a>\t\t\tрешать только <a>-е задание\n" +
268283 "\t-ex <a>-<b>\t\tрешать задания с <a> по <b> включительно\n" +
269− "\t\t\t\t(прим.: всего заданий 15)");
284+ "\t\t\t\t(прим.: всего заданий 15)\n" +
285+ "\t-mo \t\t\tминимизировать выражения по кол-ву операций\n");
270286 }
271−
272−
273− /*catch(FormatException e) {
274− Console.WriteLine("Osheebka: " + e.Message);
275− }
276− catch(Exception e) {
277− Console.WriteLine("\nНепойманное исключение: " + e.Message);
278− Console.WriteLine("\n---------------------------------------------------------------");
279− Console.WriteLine("| Report at https://github.com/frnkySila/SolveAvdoshin/issues |");
280− Console.WriteLine("---------------------------------------------------------------");
281− Console.WriteLine("\n" + e.StackTrace);
282− }*/
283287 }
284288 }
285289}