day03-.do-while循环的语法&练习

This commit is contained in:
2025-12-24 16:27:51 +08:00
parent cad8ed6c50
commit 8d3d96ceeb

View File

@@ -23,7 +23,19 @@ public class Demo05_dowhile {
System.out.println("程序结束"); System.out.println("程序结束");
//10~1 //10~1
int j = 10;
do{
System.out.println(j);
j--;
}while(j>=1);
System.out.println("程序结束");
//a~z //a~z
int k = 'a';
do{
System.out.println((char)k);
k++;
}while(k<='z');
System.out.println("程序结束");
} }
} }