1
0

Add read input method

This commit is contained in:
Serghei Cebotari 2023-08-11 10:08:25 +03:00
parent 9fb4a077cb
commit 04c720278a

View File

@ -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();
}
}
}