1、JAVA编程题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 StringTokenizer(source
4、,","); 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 = splitStringByComma("5,8,7,4,3,9,1"); int[] ii =
5、new int[s.length]; for(int i = 0;i=0;i--){ System.out.println(ii[i]); } }}2.金额转换,阿拉伯数字的金额转换成中国传
6、统的形式如:(¥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 = "零"; public static final String ONE = "壹"; public static final String T
7、WO = "贰"; public static final String THREE = "叁"; public static final String FOUR = "肆"; public static final String FIVE = "伍"; public static final String SIX = "陆"; public static final String SEVEN = "柒"; public static final String EIGHT = "捌"; public static final String NINE
8、 = "玖"; public static final String TEN = "拾"; public static final String HUNDRED = "佰"; public static final String THOUSAND = "仟"; public static final String TEN_THOUSAND = "万"; public static final String HUNDRED_MILLION = "亿"; public static final String YUAN = "元"; public sta
9、tic final String JIAO = "角"; public static final String FEN = "分"; public static final String DOT = "."; private static SimpleMoneyFormat formatter = null; private HashMap chineseNumberMap = new HashMap(); private HashMap chineseMoneyPattern = new HashMap(); private NumberForma