public void Run() { long bagCapacity = long.Parse(Console.ReadLine()); string[] safe = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); Bag bag = new Bag(bagCapacity); ItemCollector itemCollector = new ItemCollector(); itemCollector.CollectItems(bag, safe); bag.PrintBagContent(); }
public static void Main() { int bagCapacity = int.Parse(Console.ReadLine()); string[] safeContent = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries); Bag bag = new Bag(bagCapacity); ItemCollector itemCollector = new ItemCollector(); itemCollector.CollectItems(bag, safeContent); bag.PrintResult(); }