From 4a5b2edf9c839bdeb67358a72a4c3f669835b0a6 Mon Sep 17 00:00:00 2001 From: li <2811189126@qq.com> Date: Fri, 21 May 2021 11:51:58 +0800 Subject: [PATCH] 5.21 --- .../Add.cs" | 16 +++++ .../AddDiff.cs" | 18 ++++++ .../Calculate.cs" | 22 +++++++ .../Chengfa.cs" | 19 ++++++ .../Chufa.cs" | 17 ++++++ .../Program.cs" | 55 +++++++++++++++++ .../PublicCalculate.cs" | 17 ++++++ .../Circle.cs" | 18 ++++++ .../Animal.cs" | 31 ++++++++++ .../BoridType.cs" | 18 ++++++ .../Calculate.cs" | 12 ++++ .../Cat.cs" | 31 ++++++++++ .../CatType.cs" | 17 ++++++ .../ClooseAnimal.cs" | 16 +++++ .../Eagin.cs" | 33 +++++++++++ .../Program.cs" | 59 +++++++++++++++++++ .../Shape.cs" | 17 ++++++ .../Square.cs" | 18 ++++++ .../Tiger.cs" | 31 ++++++++++ .../YanZi.cs" | 33 +++++++++++ 20 files changed, 498 insertions(+) create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Add.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/AddDiff.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Calculate.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chengfa.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chufa.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Program.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/PublicCalculate.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (3)/Circle.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Animal.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/BoridType.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Calculate.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Cat.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/CatType.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/ClooseAnimal.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Eagin.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Program.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Shape.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Square.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Tiger.cs" create mode 100644 "\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/YanZi.cs" diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Add.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Add.cs" new file mode 100644 index 0000000..3f0f86e --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Add.cs" @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp11 +{ + class Add:Calculate + { + public Add(int numone ,int numtwo ,string charter) :base( numone ,numtwo ,charter){ } + public override void DisplayResult() { + Console.WriteLine(numone+charter+numtwo+"="+(numone+numtwo)); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/AddDiff.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/AddDiff.cs" new file mode 100644 index 0000000..55d87b8 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/AddDiff.cs" @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp11 +{ + class AddDiff : Calculate + { + public AddDiff(int numone, int numtwo, string charter) : base(numone, numtwo, charter) { } + + public override void DisplayResult() + { + Console.WriteLine(numone + charter + numtwo + "=" + (numone - numtwo)); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Calculate.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Calculate.cs" new file mode 100644 index 0000000..e033455 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Calculate.cs" @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp11 +{ + class Calculate + { + protected int numone { get; set; } + protected int numtwo { get; set; } + protected string charter { get; set; } + public Calculate(int numone, int numtwo, string charter) + { + this.numone = numone; + this.numtwo = numtwo; + this.charter = charter; + } + public virtual void DisplayResult() { } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chengfa.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chengfa.cs" new file mode 100644 index 0000000..ab7f345 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chengfa.cs" @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp11 +{ + class Chengfa : Calculate + { + public Chengfa(int numone, int numtwo, string charter) : base(numone, numtwo, charter) { } + + public override void DisplayResult() + { + + Console.WriteLine(numone + charter + numtwo + "=" + (numone * numtwo)); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chufa.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chufa.cs" new file mode 100644 index 0000000..4148302 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Chufa.cs" @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp11 +{ + class Chufa : Calculate + { + public Chufa(int numone, int numtwo, string charter) : base(numone, numtwo, charter) { } + public override void DisplayResult() + { + Console.WriteLine(numone + charter + numtwo + "=" + (numone / numtwo)); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Program.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Program.cs" new file mode 100644 index 0000000..f5625d6 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/Program.cs" @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp11 +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("请选择你要运算的类型:1.+ 2.- 3.x 4./"); + int key = Convert.ToInt32(Console.ReadLine()); + Calculate calculate; + switch (key) + { + case 1: + Console.WriteLine("请输入第一个数:"); + int Numone1 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("请输入第二个数:"); + int Numtwo1 = Convert.ToInt32(Console.ReadLine()); + calculate = new Add(Numone1, Numtwo1, "+"); + break; + case 2: + Console.WriteLine("请输入第一个数:"); + int Numone2 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("请输入第二个数:"); + int Numtwo2 = Convert.ToInt32(Console.ReadLine()); + calculate = new AddDiff(Numone2, Numtwo2, "-"); + break; + case 3: + Console.WriteLine("请输入第一个数:"); + int Numone3 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("请输入第二个数:"); + int Numtwo3 = Convert.ToInt32(Console.ReadLine()); + calculate = new Chengfa(Numone3, Numtwo3, "*"); + break; + case 4: + Console.WriteLine("请输入第一个数:"); + int Numone4 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("请输入第二个数:"); + int Numtwo4 = Convert.ToInt32(Console.ReadLine()); + calculate = new Chufa(Numone4, Numtwo4, "/"); + break; + default: + calculate = new Add(0, 0, "+"); + Console.WriteLine("你确实你没选择错???"); + break; + } + PublicCalculate publicCalculate = new PublicCalculate(); + publicCalculate.PublicCalculatetest(calculate); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/PublicCalculate.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/PublicCalculate.cs" new file mode 100644 index 0000000..220ec01 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (2)/PublicCalculate.cs" @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp11 +{ + class PublicCalculate + { + public void PublicCalculatetest(Calculate calculate) + { + + calculate.DisplayResult(); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (3)/Circle.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (3)/Circle.cs" new file mode 100644 index 0000000..1cc0cfc --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271 (3)/Circle.cs" @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp12 +{ + class Circle : Shape + { + public double radius; + public override void GetArea() + { + base.GetArea(); + Console.WriteLine("圆的面积为" + (3.14 * radius * radius)); + } + } +} diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Animal.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Animal.cs" new file mode 100644 index 0000000..579be84 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Animal.cs" @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class Animal + { + public int Lag { get; set; } + + + + public void Publicaction() + { + Console.WriteLine("我会走路"); + Console.WriteLine("我会吃饭"); + Console.WriteLine("我会睡觉"); + } + public virtual void Legcount() + { + //Console.WriteLine("我有{0}腿",this.Lag); + } + public virtual void Jiao() + { + //Console.WriteLine("我会叫"); + } + + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/BoridType.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/BoridType.cs" new file mode 100644 index 0000000..b061aa9 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/BoridType.cs" @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class BoridType : Animal + { + + + public void Fry() + { + Console.WriteLine("我可以飞"); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Calculate.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Calculate.cs" new file mode 100644 index 0000000..c497c85 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Calculate.cs" @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class Calculate + { + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Cat.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Cat.cs" new file mode 100644 index 0000000..2c9f246 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Cat.cs" @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class Cat : CatType + { + + public void Myaction() + { + Legcount(); + Jiao(); + + } + public override void Legcount() + { + //base.Jiao(); + Console.WriteLine("我有{0}条腿", Lag); + + } + public override void Jiao() + { + //base.Jiao(); + Console.WriteLine("我会喵喵叫!"); + + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/CatType.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/CatType.cs" new file mode 100644 index 0000000..fb8df33 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/CatType.cs" @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class CatType : Animal + { + + public void SeeNight() + { + Console.WriteLine("我可以夜视"); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/ClooseAnimal.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/ClooseAnimal.cs" new file mode 100644 index 0000000..83b4ec7 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/ClooseAnimal.cs" @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class ClooseAnimal + { + public void ThisAnimal(Animal animal) + { + animal.Publicaction(); + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Eagin.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Eagin.cs" new file mode 100644 index 0000000..11e003c --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Eagin.cs" @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class Eagin : BoridType + { + + public void Myaction() + { + Legcount(); + Jiao(); + + } + + public override void Legcount() + { + //base.Jiao(); + Console.WriteLine("我有{0}条腿", Lag); + + } + + public override void Jiao() + { + //base.Jiao(); + Console.WriteLine("我会嘎嘎叫!!!"); + + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Program.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Program.cs" new file mode 100644 index 0000000..22e6036 --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Program.cs" @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class Program + { + static void Main(string[] args) + { + //Cat cat = new Cat(); + //cat.SeeNight(); + //cat.Publicaction(); + //cat.Myaction(); + + + + //YanZi yanZi = new YanZi(); + //yanZi.Fry(); + //yanZi.Publicaction(); + //yanZi.Myaction(); + + Console.WriteLine("请选择你要选的动物:1.老虎 2.猫 3.燕子 4.老鹰"); + int key = Convert.ToInt32(Console.ReadLine()); + Animal animal; + switch (key) + { + case 1: + animal = new Tiger(); + animal.Jiao(); + break; + case 2: + animal = new Cat(); + animal.Jiao(); + break; + case 3: + animal = new YanZi(); + animal.Jiao(); + break; + case 4: + animal = new Eagin(); + animal.Jiao(); + break; + default: + animal = new Tiger(); + break; + } + + ClooseAnimal clooseAnimal = new ClooseAnimal(); + clooseAnimal.ThisAnimal(animal); + + } + } + + + +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Shape.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Shape.cs" new file mode 100644 index 0000000..52dac1b --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Shape.cs" @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp12 +{ + class Shape + { + public string color; + public virtual void GetArea() + { + + } + } +} diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Square.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Square.cs" new file mode 100644 index 0000000..a820efc --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Square.cs" @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp12 +{ + class Square : Shape + { + public int sideLen; + public override void GetArea() + { + base.GetArea(); + Console.WriteLine("长方形的面积为" + (sideLen *sideLen)); + } + } +} diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Tiger.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Tiger.cs" new file mode 100644 index 0000000..a02f4ea --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/Tiger.cs" @@ -0,0 +1,31 @@ +using System; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class Tiger : CatType + { + + + public void Myaction() + { + Legcount(); + Jiao(); + + } + public override void Legcount() + { + //base.Jiao(); + Console.WriteLine ("我有{0}条腿", Lag); + + } + + public override void Jiao() + { + //base.Jiao(); + Console.WriteLine("我会咆哮!!!"); + + } + } +} \ No newline at end of file diff --git "a/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/YanZi.cs" "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/YanZi.cs" new file mode 100644 index 0000000..edfb90d --- /dev/null +++ "b/\347\254\2541\346\254\241\344\275\234\344\270\232/\346\235\216\345\272\206\346\211\215/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/YanZi.cs" @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp10 +{ + class YanZi : BoridType + { + + + public void Myaction() + { + Legcount(); + Jiao(); + + } + public override void Legcount() + { + //base.Jiao(); + Console.WriteLine("我有{0}条腿", Lag); + + } + + public override void Jiao() + { + //base.Jiao(); + Console.WriteLine("我会叽叽叫!!!"); + + } + } +} \ No newline at end of file -- Gitee