public class Daxie2 {
public static void main(String[] args) {
while (true) {
System.out.println("请输入一个大于5小于1000的正整数");
int a = new Scanner(System.in).nextInt();
if (a < 0 || a > 1000) {
System.out.println("超出");
continue;
}
zhuanHuan(a);
}
}
public static void zhuanHuan(int a) {
String[] s={"零","一","二","三","四","五","六","七","八","九"};
int bai = a / 100;
int shi = a % 100 / 10;
int ge = a % 10;
if (a < 10) {
System.out.println(s[ge]);
}
if (a >= 10 && a < 100) {
if (ge != 0) {
System.out.println(s[shi] + "十" + s[ge]);
} else {
System.out.println(s[shi] + "十");
}
}
if (a >= 100 && a < 1000) {
if (a % 100 / 10 != 0) {
if (ge != 0) {
System.out.println(s[bai] + "百" + s[shi] + "十" + s[ge]);
} else {
System.out.println(s[bai] + "百" + s[shi] + "十");
}
}else{
if (ge != 0) {
System.out.println(s[bai] + "百" + s[shi] + s[ge]);
} else {
System.out.println(s[bai] + "百" );
}