简繁转换


private const string Jian = "阿";
private const string Fan = "阿";
static void Main(string[] args)
{

//将用户输入的简体字转换成繁体字
Hashtable ht = new Hashtable();
for (int i = 0; i < Jian.Length;i++ )
{
ht.Add(Jian[i],Fan[i]);

}

Console.WriteLine("请随便输入");
string input = Console.ReadLine();
//遍历用户输入的字符串将每个字符都转换成繁体字
for (int i = 0; i < input.Length;i++ )
{
if (ht.ContainsKey(input[i]))
{
Console.WriteLine(ht[input[i]]);
}
else
{
Console.WriteLine(input[i]);

}

}
Console.ReadKey();

posted @ 2016-04-14 22:44  思维乐趣  阅读(203)  评论(0编辑  收藏  举报