Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

take space separated input in c#

// split input string to array of strings separated by a space
string[] input = Console.ReadLine().Split(' ');
// convert each element of input to integer
int[] heights = Array.ConvertAll(input, int.Parse);
 
PREVIOUS NEXT
Tagged: #space #separated #input
ADD COMMENT
Topic
Name
1+1 =