java九九乘法表代码

public class Chengfabiao_1 {

public static void main(String[] args) {
// TODO Auto-generated method stub
int a,b;
for (a=1;a<=9;a++)
{
for (b=1;b<=a;b++)
{
System.out.print(a+"*"+b+"="+a*b+" ");
}
System.out.print("\n");
}
}
}

/**
 * è¾“出乘法口诀表
 * @author young
 *
 */
public class DulTest {
public static void main(String[] args) {
System.out.println("*************************   9×9乘法口诀表    *****************************");
for (int x = 1; x <= 9; x++) {
for (int y = 1; y <= x; y++) {
System.out.print(y + "×" + x + "=" + y * x + "\t");// println改为print不换行输出
}
System.out.println(); // æ¢è¡Œæ”¾åœ¨è¿™é‡Œ
}
}
}

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网