Add read input method
This commit is contained in:
parent
9fb4a077cb
commit
04c720278a
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user