|
今天有时间重新看了看
运行一下发现还是很多的错误
还请大哥指点一下
上我将 char ch1[] = {"shi","bai","qian","wang"};
改成了 现在的
String str1 = ""+"shi"+"bai"+"qian";
char ch1 = str.toCharArray();
这个文件是解决了~~~但是错误代码还是很可怕~~~
有23个之多~~~不过有很大一部分是重复的``````````
还请大家帮我看看`~~
- import javax.swing.*;
- import java.util.*;
- public class a2c
- {
- public static void main(String[] args)
- {
- int l;
- char[][] num = new char[3][4] ;
- char[] snum ;
- String str = "yi"+"er"+"san"+"si"+"wu"+"liu"+"qi"+"ba"+"jiu"+"shi";
- String str1 = ""+"shi"+"bai"+"qian";
- String str2 ="yuan"+"wang"+"yi";
- char ch = str.toCharArray();
- char ch1 = str1.toCharArray();
- char ch2 = str2.toCharArray();
- String input = JOptionPane.showInputDialog
- ("qing shu ru yi ge shu zi");
- double k = Integer.parseInt(input);
- long y =(long)k;
- double m =k-y;
- long x = (long)(m*100+0.5);
- for(int i =0;i<3;i++)
- { for(int j =0;j<4;j++)
- {
- num[i][j]=(char)(y%10);
- n/=10;
- }
- }
- for (int t =0;t<2;t++)
- {
- snum[t]=(char)(x%10);
- x/=10;
- }
- for(i=2;i>=0;i--)
- {
- int g=0;
- for(j=3;j>=0;j--)
- {
- if(num[i][j]==0)
- {
- l=1;
- }else{
- if(l!=0){
- System.out.println("ling");
- l=0;
- }
- System.out.println(ch[(int)num[i][j]]);
- System.out.println(ch1[j-1]);
- g=1;
- }
- }
- j=3;
- if(g!=0){
- System.out.println(ch2[i]);
- }
- }
- if(g==0) System.out.println("yuan");
- if((int)snum[0]+(int)snum[1]>0){
- if((int)snum[1]>0) System.out.println(ch[(int)snum[1]]+"fen");
- else System.out.println("ling");
- if((int)snum[0]>0) System.out.println(ch[(int)snum[0]]+"jiao");
- }
- System.out.println("\n");
- }
- }
复制代码
错误提示,也是很恐怖的~~~~555555
|
|