public void QuestionCTest(string input, string output) { var outputs = SplitByNewLine(output); IAtCoderQuestion question = new QuestionC(); var answers = SplitByNewLine(question.Solve(input).Trim()); Assert.Equal(outputs, answers); }
public void QuestionCTest(string input, string output) { var outputs = SplitByNewLine(output); IAtCoderQuestion question = new QuestionC(); var answers = question.Solve(input).Select(o => o.ToString()).ToArray(); Assert.Equal(outputs, answers); }
static void Main(string[] args) { IAtCoderQuestion question = new QuestionC(); // 問題に合わせて書き換え var answers = question.Solve(Console.In); foreach (var answer in answers) { Console.WriteLine(answer); } }
public void QuestionCTest(string input, string output) { var outputs = SplitByNewLine(output); IAtCoderQuestion question = new QuestionC(); var answers = question.Solve(input).Select(o => o.ToString()).ToArray(); foreach (var pair in outputs.Zip(answers, (exp, act) => new { exp, act })) { NearlyEquals(double.Parse(pair.exp), double.Parse(pair.act), 1e-5); } }