Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            IDrink drink = new Coffee();

            //点一杯咖啡
            //Console.WriteLine($"{drink.Description}:{drink.cost()}");
            drink = new Milk(drink);
            //Console.WriteLine($"{drink.Description}:{drink.cost()}");
            drink = new Sugar(drink);
            Console.WriteLine($"{drink.Description}:{drink.cost()}");
            Console.WriteLine("测试git1");
            Console.ReadKey();
        }