是完全倒的三角 谢谢
/**
* 倒着/反向的99乘法表。
*
* @author 赵学庆,Java世纪网(java2000.com.cn)
*
*/
public class T {
public static void main(String args[]) {
int i;
int j;
System.out.println("九九乘法表");
for (i = 9; i >= 0; i--) {
for (j = 1; j <= i; j++) {
System.out.printf("%-7s", j + "*" + i + "=" + (i * j) + " " + " ");
}
System.out.println();
}
}
}
* 倒着/反向的99乘法表。
*
* @author 赵学庆,Java世纪网(java2000.com.cn)
*
*/
public class T {
public static void main(String args[]) {
int i;
int j;
System.out.println("九九乘法表");
for (i = 9; i >= 0; i--) {
for (j = 1; j <= i; j++) {
System.out.printf("%-7s", j + "*" + i + "=" + (i * j) + " " + " ");
}
System.out.println();
}
}
}
温馨提示:答案为网友推荐,仅供参考
第1个回答 2008-10-25
public class Cfb{
public static void main(String[] args){
for(int i=1;i<=9;i++){
for(int r=1;r<=i;r++){
System.out.print(r+"*"+i+"="+i*r+"\t");
}
System.out.println();
}
}
}
public static void main(String[] args){
for(int i=1;i<=9;i++){
for(int r=1;r<=i;r++){
System.out.print(r+"*"+i+"="+i*r+"\t");
}
System.out.println();
}
}
}
第2个回答 2008-10-26
外层循环循环9次,外层循环控制内层循环次数,内层循环第1次循环9次,第2次循环8次,依次类推。
第3个回答 2008-10-26
格式好像有点问题,修改了一下
public class MultiplicateTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int i;
int j;
System.out.println("九九乘法表");
for (i = 9; i >= 0; i--) {
for (j = 1; j <= i; j++) {
System.out.printf("%-7s", j + "*" + i + "=" + (i * j) + " " + " ");
if(j != 1 && i*j <10)
{
System.out.print(" ");
}
}
System.out.println();
}
}
}
public class MultiplicateTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int i;
int j;
System.out.println("九九乘法表");
for (i = 9; i >= 0; i--) {
for (j = 1; j <= i; j++) {
System.out.printf("%-7s", j + "*" + i + "=" + (i * j) + " " + " ");
if(j != 1 && i*j <10)
{
System.out.print(" ");
}
}
System.out.println();
}
}
}
第4个回答 推荐于2017-10-08
//正三角
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(j+" * "+i+" = "+(i*j)+ " ");
}
System.out.println();
}
//倒三角
for (int i = 9; i >=1; i--) {
for (int j = 1; j<=i; j++ ) {
System.out.print(j+" * "+i+" = "+(i*j)+ " ");
}
System.out.println();
}
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(j+" * "+i+" = "+(i*j)+ " ");
}
System.out.println();
}
//倒三角
for (int i = 9; i >=1; i--) {
for (int j = 1; j<=i; j++ ) {
System.out.print(j+" * "+i+" = "+(i*j)+ " ");
}
System.out.println();
}