aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Codeforces.Console/Program.cs14
1 files 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