class Program { static void Main(string[] args) { string sEntered = Cov(Console.ReadLine()); Console.WriteLine(sEntered); } /// <summary> /// 把数字转成大写汉字返回 /// </summary> /// <param name="s">一个字符串</param> /// <returns></returns> static string Cov(string s) { char[] data= { '○','一','二','三','四','五','六','七','八','九'}; //使用数组方式,比使用ifelse或switch结构节省代码N多! char[] cs = s.ToCharArray(); for (int i = 0; i < s.Length; i++) { int j; if (Int32.TryParse(cs[i].ToString(), out j)&&cs[i].ToString()==i.ToString()) { cs[i]=data[i]; } } string str = new string(cs); return str; } }