帮个朋友问的,我自己也不知道是怎么回事,帮我看看这个是什么错误,
public class MM
{
public static void main(String args[])
{ String m[]={"","壹","貳","叁","肆","伍","陸","柒","捌","玖"};
String r[]={"元","拾","佰","仟","萬","拾","佰","仟","亿","拾","佰"};
String S[]={"角","分"};
String str01="",str02="";
int a=0;int z2[]={};
/*以下是分离整数小数*/
String str=args[0];
// String str=Input.readString();
int i=str.indexOf(".");
String str_x=str.substring(i+1);
String str_z=str.substring(0,i);
System.out.println(str_x);
System.out.println(str_z);
/*以下是整数部分*/
for (int p=0;p<str_z.length();p++)
{
char z=str_z.charAt(p);
int z1=(int)z-48;
z2=new int[str_z.length()];
z2[p]=z1;
//System.out.print(z2);
if (z2[p]!=0)
str01=str01+m[z1]+r[str_z.length()-1-p];
else
if (p==str_z.length()-1)
str01=str01+"zheng";
else
if (a==0)
{
str01=str01+"零";
a=1;
}
}
System.out.print(str01);
System.out.println();
/*以下是小数部分*/
if (str_x.length()>2)
str_x=str_x.substring(0,2);
for (int q=0;q<2;q++)
{
char x=str_x.charAt(q);
//String x2=(String)x;
//int x1=Integer.parseInt(x);
int x1=(int)x;
if ((x1-48)!=0)
{
str02=str02+m[x1-48]+S[q];
//System.out.print(q);
}
}System.out.print(str01+str02);
}
}
具体解释下!