[0628] using a for loop operation, output of the adder table

. 1  Package com.workprojects;
 2  
. 3  / ** 
. 4  * Table adder output
 . 5  * 2019-0628
 . 6  * @author L
 . 7  * 
 . 8   * / 
. 9  Import java.util.Scanner;
 10  
. 11  public  class Work062801 {
 12 is      static Scanner SC = new new Scanner (the System.in);
 13 is  
14      public  static  void main (String [] args) {
 15          of System.out.print ( "enter a value:" );
 16          int NUM = sc.nextInt();
17         System.out.println("根据这个值可以输出以下加法表:");
18         for (int i = 0; i <= num; i++) {
19             System.out.println(i + " + " + (num - i) + " = " + num);
20         }
21     }
22 }

 

Guess you like

Origin www.cnblogs.com/yanglanlan/p/11110816.html