using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;namespace ConsoleApplication6
 {
     class Suger { 
         public int Count { get; set; }
         public Suger(int n)
         {
             Count = n;
         }
     }    class Child { 
         public Suger suger;
         
         public void EatSuger(int n)
         {
             suger.Count -= n;
         }        public static Child CopyFrom(Child child)
         {
             Child c = new Child();
             c.suger = child.suger;
             //c.suger = new Suger(child.suger.Count);
             return c;
         }  
   
     }    class Program
     {
         static void Main(string[] args)
         {
             Child zhangSan = new Child();
             zhangSan.suger = new Suger(10);
             Child liSi = Child.CopyFrom(zhangSan);
             Console.WriteLine("zhangSan.suger.Count:{0}, liSi.suger.Count:{1}", zhangSan.suger.Count, liSi.suger.Count);
             zhangSan.EatSuger(2);
             Console.WriteLine("zhangSan.suger.Count:{0}, liSi.suger.Count:{1}", zhangSan.suger.Count, liSi.suger.Count);
         }
 //zhangSan.suger.Count:10, liSi.suger.Count:10
 //zhangSan.suger.Count:8, liSi.suger.Count:8
 //请按任意键继续. . .
     }
 }