博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
简繁转换
阅读量:6992 次
发布时间:2019-06-27

本文共 517 字,大约阅读时间需要 1 分钟。

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();

转载于:https://www.cnblogs.com/swlq/p/5393435.html

你可能感兴趣的文章
IT兄弟连 JavaWeb教程 Servlet表单数据
查看>>
剑法三套,程序员也能赚大钱(2) 转
查看>>
C# OpenFileDialog用法
查看>>
个人第一款小工具-批量文件重命名By Qt 5(Qt 5.2.1 + MSVC2012)
查看>>
《Java EE 开发技术与案例教程》 这是一本好书啊:简洁精辟(相见恨晚)
查看>>
十、装饰(Decorator)模式 --结构模式(Structural Pattern)
查看>>
WWDC 2013 Session笔记 - UIKit Dynamics入门
查看>>
5月7日——采用第三方页面内容,但是顶部title使用自己的
查看>>
RGBa颜色 css3的Alpha通道支持
查看>>
SSE图像算法优化系列十八:三次卷积插值的进一步SSE优化。
查看>>
unity SystemInfo类 获得电量battery
查看>>
[好文要转]【关于block使用的5点注意事项】
查看>>
Windows如何安装自定义服务
查看>>
095、如何创建Swarm集群?(Swarm02)
查看>>
结对开发地铁
查看>>
附加题
查看>>
this kernel requires an x86-64 cpu,but only detected an i686 cpu
查看>>
extjs4学习-02-导入相关文件
查看>>
python generator iterator和iterable object
查看>>
求二维数组中最大子数组的和
查看>>