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> 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 debug.txt")); Trace.Listeners.Add(new TextWriterTraceListener(Console.Out)); Trace.AutoFlush = true; string inputPath = "C:\\Users\\kkrok\\OneDrive\\Desktop\\pruf\\Pruf\\input.txt.txt"; string outputPath = "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> firstGraph = ConvertToLisListInt(branchsOne); Pr obj1 = new Pr(firstGraph); obj1.RealizationAlg(); Trace.WriteLine(obj1.ToString()); File.WriteAllText(outputPath, $"{obj1.ToString()}"); } } }