I think it is impeccable.
Inspired by dracularking, I would like to express my gratitude and share my thoughts with you.
Public class rmbconvert {
Private Static string [] faceval = new string [] {"zero", "one", "two", "three", "Si ",
"Wu", "Lu", "Lu", "Wu", "Lu "};
Private Static string [] level = new string [] {"circle", "Pick", "weight "};
Public static void main (string [] Arg ){
Stringbuffer sb = new stringbuffer ();
Try {
Bufferedreader in = new bufferedreader (New inputstreamreader (
System. In ));
String S1 = in. Readline ();
For (INT I = 0; I <s1.length (); I ++ ){
Int digit = integer. valueof (s1.substring (I, I + 1). intvalue ();
SB. append (faceval [digit]);
}
String face = sb. Reverse (). tostring ();
Stringbuffer resultsb = new stringbuffer ();
For (INT I = 0; I <face. Length (); I ++ ){
// Weighted
If (I = 0 ){
Resultsb. append (level [0]);
}
Else {
// Processing tens of thousands of BITs
If (I + 4) % 8 = 0 ){
Resultsb. append (level [4]);
}
// Processing hundreds of millions of BITs
Else if (I % 8 = 0 ){
Resultsb. append (level [5]);
}
Else {
Resultsb. append (level [I % 4]);
}
}
// Nominal value
String temp = face. substring (I, I + 1 );
Resultsb. append (temp );
}
String result = resultsb. Reverse (). tostring ();
Result = result. replaceall ("Zero pick", "zero ");
Result = result. replaceall ("zero percentage", "zero ");
Result = result. replaceall ("zero percentage", "zero ");
Result = result. replaceall ("[zero] +", "zero ");
Result = result. replaceall ("", "");
Result = result. replaceall ("zero percentage", "minimum ");
Result = result. replaceall ("0 billion ");
System. Out. println (result + "whole ");
} Catch (exception e ){
E. printstacktrace ();
}
}
}