| 查看: 725 | 回复: 5 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
[求助]
请教一个while loop的问题
|
||
|
下面两个while loop的小程序,第二个比第一个多了一行,在跳出while loop后为什么会output n=4的值? main ( ) { int n = 0; while (n++<3) printf("n is %d\n", n); printf("That's all this program does.\n" ;} OUTPUT: n is 1 n is 2 n is 3 That's all this program does. ---------------------------------------------------------------------------------------- main ( ) { int n = 0; while (n++<3) printf("n is %d\n", n); printf("n is %d\n", n); printf("That's all this program does.\n" ;} OUTPUT: n is 1 n is 2 n is 3 n is 4 That's all this program does. |
» 猜你喜欢
救命帖
已经有7人回复
限项规定
已经有6人回复
西南交通大学国家级人才团队2026年博士研究生招生(考核制)—机械、材料、力学方向
已经有3人回复
英文综述是否需要润色及查重
已经有5人回复
为什么nbs上溴 没有产物点出现呢
已经有9人回复
招博士
已经有3人回复
最失望的一年
已经有18人回复
» 本主题相关价值贴推荐,对您同样有帮助:
UDS及其后处理求助!
已经有12人回复
请教一个while loop程序的问题
已经有5人回复
5楼2011-06-07 11:16:55
mengxc
木虫 (著名写手)
- 应助: 3 (幼儿园)
- 金币: 4128.1
- 散金: 6
- 红花: 12
- 沙发: 2
- 帖子: 1342
- 在线: 491.6小时
- 虫号: 1148508
- 注册: 2010-11-16
- 专业: 数论
2楼2011-06-07 08:38:30
3楼2011-06-07 09:46:04
mengxc
木虫 (著名写手)
- 应助: 3 (幼儿园)
- 金币: 4128.1
- 散金: 6
- 红花: 12
- 沙发: 2
- 帖子: 1342
- 在线: 491.6小时
- 虫号: 1148508
- 注册: 2010-11-16
- 专业: 数论
4楼2011-06-07 09:55:12













;
回复此楼