class
Program
{
static
void
Main(string[]
args)
{
Console.WriteLine("请选择人种:1-中国人,2-美国人
:");
Person
person
= null;
string
personType
= Console.ReadLine();
switch
(personType)
{
case
"1":
person = new
Chinese();
Console.WriteLine("中国人诞生了
");
person.CreateLanguage();//为该人种建立语言
Console.WriteLine("中国人创建了汉语
");
break;
case
"2":
person = new
Englishman();
Console.WriteLine("英国人诞生了
");
person.CreateLanguage();
Console.WriteLine("英国人创建了英语
");
break;
default:
Console.WriteLine("没有此种人!");
break;
}
string
input = "";
while
(input != "Quit")
{
Console.Write("请输入词汇或者
Quit:");
input = Console.ReadLine();
person.Speak(input);
}
} |