c#制作个程序?

来源:百度知道 编辑:UC知道 时间:2024/05/21 17:31:09
写个c#代码将 数字1000转换成中文

这个代码能,自己把数字换成汉字.
你们那也叫代码?别误人子弟了.
要教会人家方法.
class Program
{
static string GetValue(char c)
{
switch (c)
{
case '0':
return "零";
case '1':
return "一";
case '2':
return "二";
case '3':
return "三";
case '4':
return "四";
case '5':
return "五";
case '6':
return "六";
case '7':
return "七";
case '8':
return "八";
case '9':
return "九";
}
return null;
}

static string GetUnit(int i)
{
switch (i)
{
case 0:
return "";
case 1:
return "十";
case 2:
return "百";
case 3:
return "千";
case 4:
return "万";
cas