| 
 
| class ForforDemo {
 public static void main(String[] args)
 {
 /*
 打印图形
 *******
 *****
 ***
 *
 */
 /*
 for(int x=1;x<=4;x++)
 {
 for(int m=1;m<x;m++)
 {
 System.out.print(" ");
 }
 
 for(int y=4;y>=x;y--)
 {
 System.out.print("*");
 }
 for(int n=3;n>=x;n--)
 {
 System.out.print("*");
 }
 System.out.println();
 
 }
 */
 /*打印九九乘法表
 1*1=1
 1*2=2        2*2=2
 1*3=3        2*3=3        3*3=9
 ...
 */
 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();
 }
 
 }
 }
 
 | 
 |