day03-.do-while循环的语法&练习
This commit is contained in:
@@ -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("程序结束");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user