import java.util.*;
public class convert
{
public static void main( String args[] )
{
double money;
System.out.print( "请输入金额:" );
Scanner scanner = new Scanner( System.in );
money = scanner.nextDouble();
String number = "零壹贰叁肆伍陆柒捌玖";
String mount = String.valueOf( money ) + *0*;
int index = mount.indexOf( "." );
int point = 0;
int index1 = index;
for( int i = 0; i < index + 3; i++, index1-- )
{
if( mount.charAt( 0 ) == *0* && mount.charAt( 1 ) != *.* )
{
System.out.println( "请规范输入!数字不要以*0*开头,0~1之间的小数例外" );
break;
}
if( mount.charAt( i ) == *0* )
continue;
if( mount.charAt( i - 1 ) == *0* )
{
System.out.print( "零" );
continue;
}
if( mount.charAt( i ) == *.* )
{
point++;
if( point > 1 )
{
System.out.println( "输入不规范!含有两个或两个以上的*.*" );
break;
}
continue;
}
System.out.print( number.charAt( ( int )mount.charAt( i ) - 48 ) );
if( index1 % 4 == 0 && index1 != 0 )
System.out.print( "仟" );
if( index1 % 4 == 3 )
System.out.print( "佰" );
if( index1 % 4 == 2 )
System.out.print( "拾" );
if( ( double )index1 / 4.00 == 0.00 )
System.out.print( "圆" );
if( ( double )index1 / 4.00 == 1.25 )
System.out.print( "万" );
if( ( double )index1 / 4.00 == 2.25 )
System.out.print( "亿" );
if( mount.contains( ".00" ) == false )
{
if( i == index + 1 )
System.out.print( number.charAt( ( int )mount.charAt( i ) - 48 ) + "角" );
if( i == index + 2 )
System.out.print( number.charAt( ( int )mount.charAt( i ) - 48 ) + "分" );
}
else
System.out.println( "整" );
}
}
}
public class convert
{
public static void main( String args[] )
{
double money;
System.out.print( "请输入金额:" );
Scanner scanner = new Scanner( System.in );
money = scanner.nextDouble();
String number = "零壹贰叁肆伍陆柒捌玖";
String mount = String.valueOf( money ) + *0*;
int index = mount.indexOf( "." );
int point = 0;
int index1 = index;
for( int i = 0; i < index + 3; i++, index1-- )
{
if( mount.charAt( 0 ) == *0* && mount.charAt( 1 ) != *.* )
{
System.out.println( "请规范输入!数字不要以*0*开头,0~1之间的小数例外" );
break;
}
if( mount.charAt( i ) == *0* )
continue;
if( mount.charAt( i - 1 ) == *0* )
{
System.out.print( "零" );
continue;
}
if( mount.charAt( i ) == *.* )
{
point++;
if( point > 1 )
{
System.out.println( "输入不规范!含有两个或两个以上的*.*" );
break;
}
continue;
}
System.out.print( number.charAt( ( int )mount.charAt( i ) - 48 ) );
if( index1 % 4 == 0 && index1 != 0 )
System.out.print( "仟" );
if( index1 % 4 == 3 )
System.out.print( "佰" );
if( index1 % 4 == 2 )
System.out.print( "拾" );
if( ( double )index1 / 4.00 == 0.00 )
System.out.print( "圆" );
if( ( double )index1 / 4.00 == 1.25 )
System.out.print( "万" );
if( ( double )index1 / 4.00 == 2.25 )
System.out.print( "亿" );
if( mount.contains( ".00" ) == false )
{
if( i == index + 1 )
System.out.print( number.charAt( ( int )mount.charAt( i ) - 48 ) + "角" );
if( i == index + 2 )
System.out.print( number.charAt( ( int )mount.charAt( i ) - 48 ) + "分" );
}
else
System.out.println( "整" );
}
}
}