import java.util.Scanner;
public class Test4 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
trans(x);
}
public static void trans(int a){
String [] str = {"零","一","二","三","四","五","六","七","八","九"};
int y = a%10;
a /=10;
if(a>0)
trans(a);
System.out.print(str[y]);
public class BaseTest {
public static void main(String [] args)throws IOException{
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
String line = "";
while ((line=bufr.readLine())!=null){
toChinese(line);
}
}
public static void toChinese(String str){
StringBuilder sb = new StringBuilder();
char [] c = {'零','一','二','三','四','五','六','七','八','九'};
char [] chs = str.toCharArray();
for(int index=0;index<str.length();index++){
int x = chs[index]-48;
sb.append(c[x]);
}
System.out.println(sb.toString());
}
}
经典的查表法作者: orsoul 时间: 2015-2-16 22:10
我也练一下手
char[] list = {'零','一','二','三','四','五','六','七','八','九',};
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));