static void Main(string[] args) { var numberOfItems = int.Parse(Console.ReadLine()); var box = new Box <int>(); while (numberOfItems-- > 0) { box.AddItems(int.Parse(Console.ReadLine())); } System.Console.WriteLine(box); }
public static void Main() { var box = new Box(); var moliv = new Pencil("red"); var himikal = new Pen("blue"); var nojica = new Scissors("Plastic"); // Приема като аргумент само Plastic / Iron Console.WriteLine(nojica.Cut()); box.AddItems(moliv, himikal, nojica); foreach (var item in box.Items) { Console.WriteLine(item); } himikal.ChangeState(); Console.WriteLine(himikal); }