- 课堂交流区
- 帖子详情
置顶
计数循环的三个问题
翁恺
发表于02月17日
<p style="outline: none; font-family: Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 微软雅黑, Helvetica, sans-serif; white-space: pre-wrap;">如果把视频中的while做的计数循环改成do-while了,那三个问题的答案还一样么?</p><p><code class="brush:java;toolbar:false">int count = 10;
do {
System.out.println(count);
count = count -1;
} while (count>0);
System.out.println("发射!");</code></p><ol class=" list-paddingleft-2" style="list-style-type: decimal;"><li><p>这个循环需要执行多少次?</p></li><li><p style="outline: none;">循环停下来的时候,有没有输出最后的0?</p></li><li><p style="outline: none;">循环结束以后,count的值是多少?</p></li></ol><p><br/></p>
43
回复
点击加载更多