Add number parse method
This commit is contained in:
parent
7ff9601f52
commit
c8172ce7c0
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user