static void Main(string[] args) { List <int> inputStones = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList(); Lake myLake = new Lake(inputStones); Console.WriteLine(string.Join(", ", myLake)); }
static void Main(string[] args) { var input = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList(); Lake <int> numbers = new Lake <int>(input); Console.WriteLine(string.Join(", ", numbers)); }
static void Main() { int[] stoneValues = Console.ReadLine().Split(", ").Select(int.Parse).ToArray(); Lake lake = new Lake(stoneValues); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { int[] stones = Console.ReadLine().Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); Lake lake = new Lake(stones); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { var input = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); Lake lake = new Lake(input); Console.WriteLine(String.Join(", ", lake)); }
public static void Main() { var stonesInLake = Console.ReadLine().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList(); Lake <int> lake = new Lake <int>(stonesInLake); Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { var stones = Console.ReadLine().Split(", ").Select(int.Parse).ToArray(); var lake = new Lake(stones); Console.WriteLine(string.Join(", ", lake)); }
static void Main() { var stones = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList(); var lake = new Lake(stones); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { Lake lake = new Lake(Console.ReadLine().Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse).ToList()); IList <int> stones = lake.Stones; IList <int> even = new List <int>(); IList <int> odd = new List <int>(); for (int i = 0; i < lake.Stones.Count; i++) { if (i % 2 == 0) { even.Add(stones[i]); } else { odd.Add(stones[i]); } } List <int> combined = new List <int>(); combined.AddRange(even); combined.AddRange(odd.Reverse()); Console.WriteLine(string.Join(", ", combined)); }
static void Main(string[] args) { int[] input = Console.ReadLine().Split(", ").Select(int.Parse).ToArray(); Lake lake = new Lake(input); Console.WriteLine(string.Join(", ", lake)); }
public static void Main(string[] args) { var input = Console.ReadLine().Split(", ").Select(int.Parse).ToArray(); var list = new Lake(input); Console.WriteLine(string.Join(", ", list)); }
public static void Main() { var stones = Console.ReadLine().Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse); var myLake = new Lake(stones); Console.WriteLine(string.Join(", ", myLake)); }
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)); }
public static void Main(string[] args) { var numbers = Console.ReadLine().Split(", ").Select(int.Parse).ToList(); var lake = new Lake(numbers); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { int[] array = Console.ReadLine().Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); Lake lake = new Lake(array); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { var input = Console.ReadLine().Split(", ").Select(int.Parse); Lake <int> lake = new Lake <int>(input); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { int[] stones = Console.ReadLine().Split(", ").Select(int.Parse).ToArray(); Lake lake = new Lake(stones); // или директно можем да подадем параметрите: Lake lake = new Lake(1,2,3,4) Console.WriteLine(string.Join(", ", lake)); }
public static void Main() { var lake = new Lake(Console.ReadLine() .Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList()); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { IList <int> numbers = Console.ReadLine().Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse).ToList(); Lake lake = new Lake(numbers); Console.WriteLine(String.Join(", ", lake)); Console.ReadLine(); }
static void Main(string[] args) { Lake <int> myLake = new Lake <int>(); int[] input = Console.ReadLine().Split(", ", StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); myLake.AddElements(input); Console.WriteLine(string.Join(", ", myLake)); }
private static Lake Cross(Lake lake) { var crossedLake = new List <int>(); foreach (var stone in lake) { crossedLake.Add(stone); } return(new Lake(crossedLake)); }
public static void Main() { var input = Console.ReadLine() .Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse).ToArray(); var lake = new Lake(input); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { List <int> numbers = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); Lake lake = new Lake(numbers); Console.WriteLine(string.Join(", ", lake.GetFrogPath())); }
static void Main(string[] args) { var stoneNumbers = Console.ReadLine() .Split(", ") .Select(int.Parse) .ToArray(); var lake = new Lake(stoneNumbers); Console.WriteLine(String.Join(", ", lake)); }
static void Main(string[] args) { var arr = Console.ReadLine() .Split(", ") .Select(int.Parse) .ToArray(); var lakes = new Lake(arr); Console.WriteLine(string.Join(", ", lakes)); }
static void Main() { List <int> input = Console.ReadLine() .Split(", ") .Select(int.Parse) .ToList(); var stone = new Lake(input); Console.WriteLine(string.Join(", ", stone)); }
public static void Main(string[] args) { var stones = Console.ReadLine() .Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToList(); var lake = new Lake <int>(stones); Console.WriteLine(string.Join(", ", lake)); }
static void Main(string[] args) { int[] stones = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); Lake lake = new Lake(stones); //Lake lake = new Lake(new int[] { 1, 2, 3, 4, 5 });// this would work just with constructor with params Console.WriteLine(string.Join(", ", lake)); }
public static void Main(string[] args) { int[] inputData = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); Lake myLake = new Lake(inputData); Console.WriteLine(String.Join(", ", myLake)); }
static void Main(string[] args) { var arr = Console.ReadLine() .Split(", ", StringSplitOptions.RemoveEmptyEntries) .Select(int.Parse) .ToArray(); var frogJumps = new Lake(arr); Console.WriteLine(string.Join(", ", frogJumps)); }