Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

read in multiple numbers c#

//Read line, and split it by whitespace into an array of strings
string[] tokens = Console.ReadLine().Split();

//Parse element 0
int a = int.Parse(tokens[0]);

//Parse element 1
int b = int.Parse(tokens[1]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #multiple #numbers
ADD COMMENT
Topic
Name
4+9 =