29 lines
589 B
C#
29 lines
589 B
C#
namespace Codeforces.Test
|
|
{
|
|
public class IOTester
|
|
{
|
|
private static StringReader? stdIn;
|
|
private static StringWriter? stdOut;
|
|
|
|
public static void Start()
|
|
{
|
|
stdOut = new StringWriter();
|
|
Console.SetOut(stdOut);
|
|
}
|
|
|
|
public static void SetInput(params string[] lines)
|
|
{
|
|
string input = string.Join(Environment.NewLine, lines);
|
|
stdIn = new StringReader(input);
|
|
Console.SetIn(stdIn);
|
|
}
|
|
|
|
public static IEnumerable<string> GetOutputLines()
|
|
{
|
|
return stdOut?.ToString()
|
|
.Split(Environment.NewLine)
|
|
.SkipLast(1)
|
|
?? Enumerable.Empty<string>();
|
|
}
|
|
}
|
|
} |