What is the English word for 21
twenty-one
22 words
twenty-one twenty-two
How to convert numbers 1-9 into English words 1-9 in Java
Put an array is the simplest, index according to the number
import java.util.Scanner ;
public class Du3 {
public static void main(String[] args) {
String[] numsAry = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
Scanner scanner = new Scanner( System.in );
System.out.print ("Please input a number between 1 and 9: ");
int num = scanner.nextInt ();
System.out.println (num + " to corresponding string is: " + numsAry[num]);
}
}
----------------
Please input a number between 1 and 9: 5
5 to corresponding string is: five
English cardinal 1 ~ 21 words, ordinal 21 words
It'll be done by 11:00
By the way, write down the ordinal words for the red flag
one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen ninteen twenty twenty-one first second third fourth fifth sixth seventh eighth ninet...