public void QuestionF_RerootingClassTest(string input, string output) { var outputs = SplitByNewLine(output); IAtCoderQuestion question = new QuestionF_RerootingClass(); var answers = question.Solve(input).Select(o => o.ToString()).ToArray(); Assert.Equal(outputs, answers); }
static void Main(string[] args) { IAtCoderQuestion question = new QuestionF_RerootingClass(); // 問題に合わせて書き換え var answers = question.Solve(new StreamReader(@"C:\Users\amats\Downloads\line_01.txt")).ToArray(); var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(writer); foreach (var answer in answers) { Console.WriteLine(answer); } Console.Out.Flush(); }