static void Main(string[] args) { int[] stones = Console.ReadLine()?.Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); Lake lake = new Lake(stones); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { List <int> stones = Console.ReadLine().Split(", ").Select(int.Parse).ToList(); Lake lake = new Lake(stones); Console.WriteLine(string.Join(", ", lake)); }
static void Main() { var inputNums = Console.ReadLine().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList(); Lake game = new Lake(inputNums); game.Play(); }
static void Main(string[] args) { int[] nums = Console.ReadLine().Split(", ").Select(int.Parse).ToArray(); Lake lake = new Lake(nums.ToList()); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { int[] stones = Console.ReadLine().Split(", ") .Select(int.Parse).ToArray(); Lake lakeStones = new Lake(stones); Console.WriteLine(string.Join(", ", lakeStones)); }
public static void Main(string[] args) { var numbers = Console.ReadLine().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse); var stones = new Lake(numbers.ToList()); Console.WriteLine(string.Join(", ", stones)); }
public static void Main() { List <int> elements = Console.ReadLine().Split(", ").Select(int.Parse).ToList(); Lake <int> lake = new Lake <int>(elements); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { var input = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); var numbers = new Lake(input); Console.WriteLine(string.Join(", ", numbers)); }
public static void Main() { var numbers = Console.ReadLine().Split(new[] { ',', ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToList(); var lake = new Lake(numbers); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { Lake lake = new Lake(Console.ReadLine() .Split(", ") .Select(int.Parse) .ToArray()); Console.WriteLine(String.Join(", ", lake)); }
public static void Main() { var elements = Console.ReadLine() .Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse).ToList(); var lake = new Lake <int>(elements); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { List <int> stones = Console.ReadLine() .Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); Lake lake = new Lake(stones); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { var stones = Console.ReadLine() .Split(" ,".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); var lake = new Lake(stones); Console.Write(string.Join(", ", lake)); }
public static void Main() { var inputStones = Console.ReadLine() .Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); Lake myLake = new Lake(inputStones); Console.WriteLine(string.Join(", ", myLake)); }
private static void Main() { IList <int> numbers = Console.ReadLine().Split(new[] { ", ", " ", "," }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse).ToList(); Lake <int> lake = new Lake <int>(numbers); lake.Move(); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { var inputNumbers = Console.ReadLine() .Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); var lake = new Lake(inputNumbers); Console.WriteLine(string.Join(", ", lake)); }
static void Main() { var input = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); var lake = new Lake(input); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { var stonesInput = Console.ReadLine() .Split(new[] { ",", " " }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); var jumpsResult = new Lake(stonesInput); Console.WriteLine(string.Join(", ", jumpsResult)); }
static void Main(string[] args) { List <int> list = new List <int>(Console.ReadLine() .Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList()); Lake lake = new Lake(list); lake.Print(); }
static void Main() { int[] input = Console.ReadLine(). Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries). Select(int.Parse). ToArray(); Lake lake = new Lake(input); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { List <int> numbers = Console .ReadLine() .Split(", ") .Select(int.Parse) .ToList(); Lake stonesNumber = new Lake(numbers); Console.WriteLine(string.Join(", ", stonesNumber)); }
public static void Main() { var stoneNumbers = Console.ReadLine() .Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse); var lake = new Lake(stoneNumbers); var sb = new StringBuilder(); foreach (var stone in lake) { sb.Append(stone + ", "); } Console.WriteLine(sb.ToString()); }
static void Main(string[] args) { var numbers = Console.ReadLine() .Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); var lake = new Lake(numbers); var result = string.Empty; foreach (var jump in lake) { result += jump + ", "; } Console.WriteLine(result.Substring(0, result.Length - 2)); }
static void Main(string[] args) { List <string> inputNumbers = Console.ReadLine().Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); Lake <string> lake = new Lake <string>(inputNumbers); string result = ""; foreach (var element in lake) { result += string.Format($"{element}, "); } Console.WriteLine(result.Substring(0, result.Length - 2)); }
public static void Main() { List <int> numbers = Console.ReadLine().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList(); var lake = new Lake(numbers); var result = new StringBuilder(); foreach (var number in lake) { result.Append(number + ", "); } Console.WriteLine(result.ToString().Trim().TrimEnd(',')); }
public static void Main(string[] args) { int[] stones = Console.ReadLine()? .Split(", ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); Lake lake = new Lake(stones); /*List<int> path = new List<int>(); * foreach (int stone in lake) * { * path.Add(stone); * }*/ Console.WriteLine(String.Join(", ", lake)); }
public static void Main() { var stones = Console.ReadLine() .Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); var result = new List <int>(); var lake = new Lake(stones); foreach (var stone in lake) { result.Add(stone); } Console.WriteLine(string.Join(", ", result)); }
static void Main() { string input = Console.ReadLine(); int[] tokens = input.Split(", ") .Select(int.Parse) .ToArray(); Lake lake = new Lake(tokens); var stones = new List <int>(); foreach (var stone in lake) { stones.Add(stone); } Console.WriteLine(String.Join(", ", stones)); }
public static void Main() { int[] inputNums = Console.ReadLine() .Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); Lake <int> myLake = new Lake <int>(inputNums); StringBuilder builder = new StringBuilder(); foreach (var item in myLake) { builder.Append($"{item}, "); } Console.WriteLine(builder.ToString().TrimEnd(' ', ',')); }
public static void Main() { int[] numbers = Console.ReadLine() .Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); Lake lake = new Lake(numbers); List <int> list = new List <int>(); foreach (var currentStone in lake) { list.Add(currentStone); } Console.WriteLine(String.Join(", ", list)); }