- import java.io.*;
- import java.util.*;
- public class Test4 {
- public static void main(String[] args)throws Exception {
- chuancan();
- }
- public static void chuancan()throws Exception
- {
- System.out.println("请输入一串正整数数字");
- BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
- String p=br.readLine();
- quchu( p);
- }
- public static void quchu(String p)
- {
- String []str=new String[]{"零","一","二","三","四","五","六","七","八","九"};
- StringBuilder sb=new StringBuilder();
- sb.append(p);
- for(int i=0;i<sb.length();i++)
- {
- int t= Integer.parseInt( sb.substring(i, i+1));
- sop(str[t]);
- }
- }
- public static void sop(Object obj)
- {
- System.out.print(obj);
- }
- }
复制代码
|