Beispiel #1
0
        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();
        }
Beispiel #2
0
        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();
        }