From 04c720278a3eb5b45ddf9683f5f42255dff23d09 Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Fri, 11 Aug 2023 10:08:25 +0300 Subject: [PATCH] Add read input method --- Codeforces.Console/Program.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Codeforces.Console/Program.cs b/Codeforces.Console/Program.cs index ac18de4..029f76d 100644 --- a/Codeforces.Console/Program.cs +++ b/Codeforces.Console/Program.cs @@ -4,14 +4,22 @@ { public static void Main() { - int count = int.Parse(Console.ReadLine()!); - for (int i = 0; i < count; i++) + int count = int.Parse(Console.ReadLine()); + for (int i = 0; i < count; i++) { - var numbers = Console.ReadLine()! + var numbers = Console.ReadLine() .Split(' ') .Select(x => int.Parse(x)); Console.WriteLine(numbers.Sum()); } } + + public static int[] ParseInput() + { + return Console.ReadLine() + .Split(' ') + .Select(x => int.Parse(x)) + .ToArray(); + } } } \ No newline at end of file