C#中数字转换成中文的程序
1、人民币大写转换程序 要求:如输入:1234
输出:壹仟贰佰叁拾肆圆 提示:汉字大写数字金额:零、壹、贰、叁、肆、伍、陆、柒、捌、玖、拾、佰、仟、万、亿 最好用数组写出来~不行的话一般的也行!
答案:唉,我也没想出来。在特定位置插入字符串这个不知道咋写。我只能做出这个样子 请输入一个数字:
1234
壹贰叁肆元楼主见谅~!
char arrayWord[] = new char[] { '零', '壹', '贰', '叁', '肆', '伍', '陆', '柒',
'捌', '玖' };
Scanner input = new Scanner(System.in);
System.out.println("请输入一个数字:");
String inputNum = input.next();
int word;
for (int j = 0; j < inputNum.length(); j++) {
word = Integer.parseInt(inputNum.substring(j, j + 1));
String arraycode[] = new String[] { "拾", "佰", "仟", "万", "十万", "百万",
"千万", "亿" };System.out.print(arrayWord[word]);
}
System.out.println("元");}
http://www.51zxw.net/study.asp?vip=1720373 这个 自学网站 讲解的非常好 可以考虑 去看看啊。
上一个:C# GDI+ 自绘按钮的问题
下一个:C#,见详细问题