Because I do not see the actual code you tried I can just assume you did something like:
int input = Convert.ToInt32(Console.ReadLine());
and the actual input was "10 2", which is a string.
The error occured when the method tried to convert the empty space to an int.
You need to save the input as a string variable, then split the string variable with empty spaces as seperator. You can save the result as an string array (string[]) and then convert each array element of the string[] to an int.
Reading the input for your code:
string input = Console.Readline();
Split method for your code:
string[] stringArray= input.Split(' ');
Convert each string to an int for your code:
List<int> integerList = new List<int>();
foreach (string str in array)
{
integerList.Add(Convert.ToInt32(str));
}
Note, that this would also work for an input with more than 2 numbers, for example "10 2 17 3 19 27" and you do not need an own variable for each input part because you add each value to a list. Why a list ? because the size is dynamic. Your problem would also work with an array instead of a list because at the moment you split your string you know the size the intArray would need but a list is more comfortable.