public void QuestionJTest(string input, string output) { var outputs = SplitByNewLine(output); IAtCoderQuestion question = new QuestionJ(); var answers = question.Solve(input).Select(o => o.ToString()).ToArray(); Assert.Equal(outputs, answers); }
public void QuestionJTest(string input, string output) { var outputs = SplitByNewLine(output); IAtCoderQuestion question = new QuestionJ(); var answers = SplitByNewLine(question.Solve(input).Trim()); Assert.Equal(outputs, answers); }
static void Main(string[] args) { IAtCoderQuestion question = new QuestionJ(); // 問題に合わせて書き換え var answers = question.Solve(Console.In); foreach (var answer in answers) { Console.WriteLine(answer); } }
public void QuestionJTest(string input, string output) { var outputs = SplitByNewLine(output).Select(double.Parse).ToArray(); IAtCoderQuestion question = new QuestionJ(); var answers = question.Solve(input).Select(o => o.ToString()).Select(double.Parse).ToArray(); Assert.Equal(outputs.Length, answers.Length); for (int i = 0; i < answers.Length; i++) { Assert.True(Math.Abs(outputs[i] - answers[i]) < 1e-9); } }