Пример #1
0
        private static void Main(string[] args)
        {
            Girl girl = new Goddess();

            Console.WriteLine("女神改变计划开始:");
            GoodGirl goodGirl = new Beautiful(girl);

            Console.WriteLine("让女神变漂亮");
            goodGirl.Speak();
            Console.WriteLine("-------------------");
            Console.WriteLine("让女神变富有");
            goodGirl = new Rich(girl);
            goodGirl.Speak();
            Console.ReadLine();
        }
Пример #2
0
 private static void Main(string[] args)
 {
     Girl girl = new Goddess();
     Console.WriteLine("女神改变计划开始:");
     GoodGirl goodGirl = new Beautiful(girl);
     Console.WriteLine("让女神变漂亮");
     goodGirl.Speak();
     Console.WriteLine("-------------------");
     Console.WriteLine("让女神变富有");
     goodGirl = new Rich(girl);
     goodGirl.Speak();
     Console.ReadLine();
 }