返回列表 發帖
  1. public class Ch12 {

  2.         public static void main(String[] args)
  3.         {
  4.                 for(int i=1; i<=9; i++)
  5.                 {
  6.                         for(int j=1; j<=9; j++)
  7.                         {
  8.                                 System.out.println(i+"x"+j+"="+(i*j)+"\t");
  9.                         }
  10.                 }
  11.                
  12.                        
  13.         }
  14.                        
  15.                        




  16.         }
複製代碼

TOP

  1. public class Ch12{
  2.         public static void main(String args[])
  3.         {
  4.                 int i=1;
  5.                 while(i<=9)
  6.                 {
  7.                         int j=1;

  8.                         while(j<=9)
  9.                         {
  10.                                 System.out.print((i+"x"+j+"="+(i*j)+"\t"));
  11.                                 j++;
  12.                         }
  13.                         i++;
  14.                         System.out.println();

  15.                 }
  16.         }

  17. }
複製代碼

TOP

返回列表