1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Pruf
- {
- internal class Program
- {
- public static List<List<int>> ConvertToLisListInt(string[] allLines) => allLines.Select(line=>line.Split(' ').Select(int.Parse).ToList()).ToList();
- static void Main(string[] args)
- {
- Trace.Listeners.Add(new TextWriterTraceListener("Trace and debug1.txt"));
- Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
- Trace.AutoFlush = true;
-
- string inputPath = "C:\\Users\\Громовие\\source\\repos\\Ekzamen\\Ekzamen\\input.txt";
- string outputPath = "C:\\Users\\Громовие\\source\\repos\\Ekzamen\\Ekzamen\\output.txt";
- string[] allLines = File.ReadAllLines(inputPath);
- int indexSeparator = Array.IndexOf(allLines, "-");
- string[] branchsOne = allLines.Take(indexSeparator).ToArray();
- string[] branchsTwo = allLines.Skip(indexSeparator+1).ToArray();
- List<List<int>> firstGraph = ConvertToLisListInt(branchsOne);
-
- Pr obj1 = new Pr(firstGraph);
-
- obj1.RealizationAlg();
-
- Trace.WriteLine(obj1.ToString());
-
- File.WriteAllText(outputPath, $"{obj1.ToString()}");
- }
- }
- }
|