From c8172ce7c02d50d231ac74a8bfb97e52f943f161 Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Mon, 14 Aug 2023 13:47:02 +0300 Subject: [PATCH] Add number parse method --- Codeforces.Console/Program.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Codeforces.Console/Program.cs b/Codeforces.Console/Program.cs index 49db58b..3fa975f 100644 --- a/Codeforces.Console/Program.cs +++ b/Codeforces.Console/Program.cs @@ -4,20 +4,25 @@ { public static void Main() { - int count = int.Parse(Console.ReadLine()); + int count = ParseNumber(); for (int i = 0; i < count; i++) { - var numbers = ParseInput(); + var numbers = ParseNumbers(); Console.WriteLine(numbers.Sum()); } } - public static int[] ParseInput() + public static int[] ParseNumbers() { return Console.ReadLine() .Split(' ') .Select(x => int.Parse(x)) .ToArray(); } + + public static int ParseNumber() + { + return int.Parse(Console.ReadLine()); + } } } \ No newline at end of file