I have a task to read n given numbers in a single line, separated by a space ( ) from the console.
I know how to do it whe
you can use this function, it's very helpful
static List inputs = new List();
static int input_pointer = 0;
public static string cin(char sep = ' ')
{
if (input_pointer >= inputs.Count)
{
string line = Console.ReadLine();
inputs = line.Split(sep).OfType().ToList();
input_pointer = 0;
}
string v = inputs[input_pointer];
input_pointer++;
return v;
}
Example:
for(var i =0; i