Ceci est le tableau de multiplication 99 que j'ai mémorisé quand j'étais enfant. C'est la version chinoise, pas la version numérique, et elle a été imprimée à l'aide d'un programme Java.
Le programme Source Java est le suivant:
package com.elephant.multiply99Table; public class Multiply99Table {public static String convert (int digit) {string [] numérique = {"dix", "un", "deux", "trois", "quatre", "cinq", "six", "sept", "huit", "neuf"}; if (chiffre <10) RETOUR DIGITWORDS [DIGIT]; else if (numérique == 10) return numériquewords [numérique / 10] + numériquewords [0]; else return 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)? "": "get") + convert (i * j)); System.out.print (((i * j> 10)? "": "")); } System.out.println (""); // Break de ligne}}}Les résultats de l'exécution du programme sont les suivants:
One gets one gets one gets two gets three gets three gets four gets five gets five gets six gets seven gets seven gets eight gets nine gets two gets four gets eight gets five gets two gets six gets two gets eight gets five gets two gets six gets eight gets five gets two gets two gets six gets eight gets five gets two gets two gets two gets six gets two gets eight gets five gets two gets two gets two gets two gets two gets two gets two gets two gets two gets two gets two gets two gets three gets three gets three gets three gets three gets three gets three gets three gets three gets three gets three gets three gets three gets three gots two gots three gots three gots two gots three gots three gots two gots three gots three gots three gots two gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three gots three Gots trois compats trois compats de trois compats trois mars trois compats trois mars trois compats trois mars trois compats trois mars trois comptts trois gots trois compats trois mars trois mars trois majustes trois compats trois gats trois comptts trois gotts trois gotts trois compats trois gots trois gots trois gots trois gots trois gots trois gots trois gots trois gots trois gots trois gots gots Three Gots Three Gots Three Gots Threans GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS GOTS TROIS TROIS TROIS GOTS TROIS GOTS TROIS TROIS GOST
Ce qui précède concerne cet article, j'espère qu'il sera utile pour tout le monde d'apprendre la programmation Java.