Print out a multiplication table for the cycle

//anti

 for (int x=9; x>=1; x--){

            // nested inside a for loop, the number of print columns;  

            for (int y =1; y<=x; y++) {  

                // loop for internal printout result; wherein "\ t" is a tab-delimited, aesthetic effect is multiplication table;  

                System.out.print(y+"*"+x+"="+y*x+"\t");  

            }

            // print out the inner loop for the column, for the outer wrapping cycle;  

            System.out.println();

 }  

//positive

// print the number of rows

   for(int i=1;i<=9;i++) {

         for(int j=1;j<=i;j++) {

              System.out.print(i+"*"+j+"="+i*j+"\t");

         }

               System.out.println();

    }

Guess you like

Origin blog.csdn.net/weixin_40873693/article/details/78482964