?? jadefox3.java
字號:
import java.io.*;
public class jadefox3
{
public static void main(String[] args) throws IOException
{
char ch;
int n,i=0;
String st;
System.out.println("Please Input 3 numbers!");
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
st=in.readLine();
if(st.length()!=3)
System.out.println("You do not input 3 numbers,please try it again!");
else
{
while(i<3)
{
ch=st.charAt(i);
if((i==1&&ch=='0')&&(st.charAt(i-1)!='0')&&(st.charAt(i+1)!='0'))
System.out.print("零");
switch(ch)
{
case '1': System.out.print("壹");
break;
case '2': System.out.print("貳");
break;
case '3': System.out.print("叁");
break;
case '4': System.out.print("肆");
break;
case '5': System.out.print("伍");
break;
case '6': System.out.print("陸");
break;
case '7': System.out.print("柒");
break;
case '8': System.out.print("捌");
break;
case '9': System.out.print("玖");
break;
}
if((i!=0||i!=1)&&ch!='0')
{
switch(i)
{
case 0: System.out.print("佰");break;
case 1: System.out.print("拾");break;
}
}
if(i==2)
System.out.print("元整");
i++;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -