I00027 Java Language Program-print 99 multiplication table

Source: Internet
Author: User

This is a childhood back of the 99 multiplication table, is the Chinese version, not the digital version, with the Java program printed out.

The Java source program is as follows:

Package Com.elephant.multiply99table;public class Multiply99table {public static String Convert (int digit) {string[]  Digitwords = {"Ten", "One", "two", "three", "four", "five", "six", "seven", "eight", "Nine"};if (Digit <) return Digitwords[digit];else if (digit  = =) return DIGITWORDS[DIGIT/10] + digitwords[0];elsereturn DIGITWORDS[DIGIT/10] + digitwords[0]+ digitWords[digit% 10];} public static void Main (string[] args) {for (int i = 1; I <= 9; i++) {for (int j = i; J <= 9; j + +) {System.out.print (Convert (i) + convert (j) + ((i * j >= 10)? ":") + Convert (i * j)); System.out.print (((i * j > 10)? "  " : "   "));} System.out.println (""); Line Change}}}

The results of the program run as follows:

One by one is 112, 213 is 314, 415 is 516, 617 is 718, 819 is nine.
22 to 423, 624 to 2.,612,271,428,245,43e,+15.
33 is 2.,351,536,183,721,38e,+20.
6.,452,462,447,284,83e,+19
556,357,355,851,465
6,674,268,493,584
978,575,703
57,832
9,981




I00027 Java Language Program-print 99 multiplication table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.