# 如何将100转换为零（不是零）？

``````public static void numberToWords(int number) {
if (number == 0) {
System.out.println("Zero");
} else if (number < 0) {
System.out.println("Invalid Value");
}

int revInteger = reverse(number);
while (revInteger != 0) {
int modulus = revInteger % 10;
revInteger /= 10;

switch (modulus) {

case 1:
System.out.println("One");
break;

case 2:
System.out.println("Two");
break;

case 3:
System.out.println("Three");
break;

case 4:
System.out.println("Four");
break;

case 5:
System.out.println("Five");
break;

case 6:
System.out.println("Six");
break;

case 7:
System.out.println("Seven");
break;

case 8:
System.out.println("Eight");
break;

case 9:
System.out.println("Nine");
break;

default:
break;
}
}
}

public static int reverse(int reversedNumber) {
int revNumber = reversedNumber;
int digit = 0;
while (revNumber != 0) {
int n = revNumber % 10;
digit = digit * 10 + n;
revNumber /= 10;
}
return digit;
}

public static int getDigitCount(int number) {
int count = 0;
if (number > 0) {
while (number != 0) {
number /= 10;
++count;
}
return count;
} else if (number == 0) {
return 1;
}
return -1;
}
``````