菜鸟的博客

纵有疾风起,人生不言弃。

导航

2023.7.11

 1 //2023.7.11 周二
 2 //for循环
 3 public class test
 4 {
 5     public static void main(String[] args)
 6     {
 7         //打印九九乘法表
 8         for(int i = 1;i<=9;i++)
 9         {
10             for(int j = 1;j<=i;j++)
11             {
12                 System.out.print(j+"*"+i+" = "+(j*i)+"    ");
13             }
14             System.out.println();
15         }
16     }
17 }
18 //增强for循环
19 public class test
20 {
21     public static void main(String[] args)
22     {
23         int[] numbers = {10,20,30,40,50};
24         for(int x:numbers)
25         {
26             System.out.println(x);
27         }
28 
29     }
30 }

 

posted on 2023-07-11 20:34  hhmzd233  阅读(17)  评论(0编辑  收藏  举报