static void Main(string[] args) { Console.WriteLine("请输入打招呼的语言"); Program pr = new Program(); pr.S(); string Sayw = Console.ReadLine(); SayHello sh = GetSayHello(Sayw); if (sh != null) { sh.Sayhello(); } else { Console.WriteLine("输入有误"); } Console.ReadKey(); }