day03-循环控制语句--循环的嵌套

This commit is contained in:
2026-01-16 14:05:37 +08:00
parent d58ecfb853
commit 74beb0f748

View File

@@ -8,6 +8,12 @@ public class Demo15 {
public static void main(String[] args) {
//for循环的嵌套实现时钟的效果 00点01分~00点59分-1点01分~23点59分
//一天0~23个小时 每小时有0~59分
for (int i = 0; i < 24; i++) {//0~23 外层循环 时
for (int j = 0; j < 60; j++) {//0~59 内层循环 分
System.out.println(i+""+j+"");
}
}
System.out.println("程序结束");
}