1、JAVA编程题(共计11题)1.现在输入n个数字,以逗号,分开;然后可选择升或者降序排序;按提交键就在另一页面显示按什么排序,结果为,提供resetimport java.util.*;public class bycomma{ public static String[] splitStringByComma(String source){ if(source==null
2、
3、source.trim().equals("")) return null; StringTokenizer commaToker = new
4、StringTokenizer(source,","); String[] result = new String[commaToker.countTokens()]; int i=0; while(commaToker.hasMoreTokens()){ result[i] = commaToker.nextToken(); i++; } return result; } public static void main(String args[]){ String[] s = splitString
5、ByComma("5,8,7,4,3,9,1"); int[] ii = new int[s.length]; for(int i = 0;i=0;i--){ Sys
6、tem.out.println(ii[i]); } }}2.金额转换,阿拉伯数字的金额转换成中国传统的形式如:(¥1011)->(一千零一拾一元整)输出。package test.format;import java.text.NumberFormat;import java.util.HashMap;public class SimpleMoneyFormat { public static final String EMPTY = ""; public static final String ZERO = "零";
7、public static final String ONE = "壹"; public static final String TWO = "贰"; public static final String THREE = "叁"; public static final String FOUR = "肆"; public static final String FIVE = "伍"; public static final String SIX = "陆"; public static final String SEVE
8、N = "柒"; public static final String EIGHT = "捌"; public static final String NINE = "玖"; public static final String TEN = "拾"; public static final String HUNDRED = "佰"; public static final String THOUSAND = "仟"; public static final String TEN_THOUSAND = "万"; publ
9、ic static final String HUNDRED_MILLION = "亿"; public static final String YUAN = "元"; public static final String JIAO = "角"; public static final String FEN = "分"; public static final String DOT = "."; private static SimpleMoneyFormat formatter = null; private Hash
10、Map chineseNumberMap = new HashMap(); private HashMap chineseMoneyPattern = new HashMap(); private NumberFormat num