Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- public class Program
- {
- public static void Main()
- {
- //the user enters the values as a string devided by spaces or comas
- string input = Console.ReadLine();
- //transfroming the single string input to a string array then to an int array
- int[] arr = input.Split(new char[]{',',' '},StringSplitOptions.RemoveEmptyEntries).Select(x=>int.Parse(x)).ToArray();
- for(int i =0;i<arr.Length;i++)
- {
- Console.WriteLine(arr[i]);
- }
- }
- }
Add Comment
Please, Sign In to add comment