用Java语言如何做一个九九乘法表

如题所述

public class Test{
public static void main(String[] args) {
for(int x=1;x<=9;x++){
for(int y=1;y<=x;y++){
System.out.print(y+"*"+x+"="+(x*y)+"\t");
}
System.out.println();
}
}
}

温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-09-16
public class Hello {
public static void main(String args[]) {
for(int x = 1 ; x <= 9 ; x ++) {
for(int y = 1 ; y <= x ; y ++) {
System.out.print(x + "*" + y + "=" + x * y + "\t") ;
}
System.out.println();//换行
}
}
}
第2个回答  2015-10-12
public class Test{

public static void main(String [] args){
for(int x=1;x<10;x++){
for(int y=1;y<=x;y++){
System.out.print(y+"*"+x+"="+x*y+" ");

}
System.out.println();
}

}
}
第3个回答  推荐于2016-09-07
class NineMNine { public static void main(String args[]) { outer: for(int i=1;i<10;i++) { for(int j=1;j<10;j++) { if(j>i) { System.out.println(" "); continue outer; } System.out.print(" "+i+"*"+j+"="+(i*j)); } } } }本回答被提问者采纳

相关了解……

你可能感兴趣的内容

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