background image

        static void Main(string[] args)
        {
            B b = new B();
            b.fun();
        }
    }

    class A
    {
        public int X{ private get;set; }
    }

    class B
    {
        protected A a = new A();
        public void fun(){
            a.X = 10;
            Console.WriteLine(a.X);
        }
    }
}
结果:

6. 请给出以下程序的输出结果
namespace TestPaper
{
    class Program
    {

static void Main(string[] args)

        {
            int x = 5, y = 8, z = 11;
            Console.WriteLine(++x * --y + z++);
        }

   

 }

}
结果:

 3 / 16