我也练一下手
- char[] list = {'零','一','二','三','四','五','六','七','八','九',};
- BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
- String str = bufr.readLine();
- for (int i=0; i<str.length(); i++) {
- int index = str.charAt(i) - '0';
- System.out.print(list[index]);
- }
复制代码 |