- import java.util.Scanner;
- public class Demo2 {
- public static void main(String[] args)throws Exception{
- Scanner sn =new Scanner(System.in);
- String[] str = {"零","一","二","三","四","五","六","七","八","九"};
- StringBuffer sb1 = new StringBuffer();
- StringBuffer sb2 = new StringBuffer();
- sb1.append(sn.nextInt());
- for(int i =0;i<sb1.length();i++){
- int a = Integer.parseInt(sb1.substring(i, i+1));
- sb2.append(str[a]);
- }
- System.out.println(sb2.toString());
-
-
- }
- }
复制代码 |
|