Output and reverse output multiplication table multiplication table of

Multiplication table is something we often primary back, the following code to achieve a positive sequence output and reverse output of the multiplication table

Reverse output

package com.qianfeng.ls.jj;

public class Demo99 {

	public static void main(String[] args) {

		// 在控制台打印一个99乘法表
		
		for(int i = 1 ; i <= 9 ; i++) {
			
			//这个循环就是负责一行的内容【你需要换行吗?】
			for(int j = 1 ; j <= i ; j++) {
				System.out.print(j + "*" + i + "=" + i*j + "\t");
			}
			
			System.out.println();
			
		}
		
		
	}

}


Achieve results

Positive sequence output multiplication table


```java
package com.qianfeng.ls.jj;

public class Demo99 {

	public static void main(String[] args) {

		// 在控制台打印一个99乘法表
		
		for(int i = 1 ; i <= 9 ; i++) {
			
			//这个循环就是负责一行的内容【你需要换行吗?】
			for(int j = 1 ; j <= i ; j++) {
				System.out.print(j + "*" + i + "=" + i*j + "\t");
			}
			
			System.out.println();
			
		}
		
		
	}

}

`

The following is a picture of normal order output

Positive sequence output

Published 32 original articles · won praise 9 · views 3153

Guess you like

Origin blog.csdn.net/weixin_43501566/article/details/104545528