12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 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 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<List<int>> firstGraph = ConvertToLisListInt(branchsOne);
-
- Pr obj1 = new Pr(firstGraph);
-
- obj1.RealizationAlg();
-
- Trace.WriteLine(obj1.ToString());
-
- File.WriteAllText(outputPath, $"{obj1.ToString()}");
- }
- }
- }
|