??????????????????
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
///<summary>
/// ????????????????????//////////////////////////
///</summary>
interface IAnimal  //??????
{
void eating();
//??????????????????????????static??abstract????
}
abstract class Bird :IAnimal   //??????Bird?????IAnimal???
{
public void eating() { Console.WriteLine("????"); } //???????????????????????????÷???
abstract public void flying();                                           //?????????????????????????
}
class Chick : Bird     //Chick?????????Bird????????
{
public int chibangnumber;
public Chick()
{
Console.WriteLine("???????С????");
chibangnumber = 2;
}
//???????????flying????????override
public override void flying()
{  Console.WriteLine("????У?");  }
};
///<summary>
/// ???γ?????????????????????????????A????????B??г?????A????C??г?????B
/// ?????е??????????????????????????????????й?????
///</summary>
abstract class A   //??????A??????
{
public int x; //??????г??
public A(int m) { x = m; }  //??????A???????
abstract public int fun1(); //??????fun1()????
}
abstract class B : A //??B?????????
{
public B(int m):base(1) { x = m; }  //??????A???????
abstract public int fun2(); //???????????????fun2()
public abstract int px { get;set; } //???????????px???????д
public abstract int py { get; }     //???????????py?????
}
class C: B  //??C????????????B????????????е??????
{
int y?? z;
public C(int x1?? int y1):base(x1) //??????
{ y = x1; z = y1; }
public override int fun1() //??????fun1???
{  return x * y;  }
public override int fun2() //??????fun2???
{  return x / y;  }
public override int px  //????????px?????
{
get
{
try   { return x+10; }
catch {throw new Exception("The method or operation is not implemented."); }
}
set
{   try   { x = value; }
catch { throw new Exception("The method or operation is not implemented."); }
}
}
public override int py  //????????py?????
{
get
{   try  { return y-10; }
catch{ throw new Exception("The method or operation is not implemented."); }
}
}
}
class Program  //??????
{
static void Main(string[] args)
{
//??????
Chick ch = new Chick();
ch.eating();
ch.flying();
Console.WriteLine("????????:{0}"?? ch.chibangnumber);
//???γ????????
C c = new C(5??2); //??????c?????C
Console.WriteLine("{0}??{1}"?? c.fun1()??c.fun2());
Console.WriteLine("{0}"?? c.x);
Console.WriteLine("{0}??{1}"?? c.px??c.py); //???ó???????
}
}
}
???????н????
???????????С????
????????
????????У?
????????????2
????25??1
????5