break&continue
2016-07-29 15:49
375 查看
#include <iostream> #include <cstdlib> using std::cout; using std::endl; int main() { for (int i = 0; i < 9; i++) { cout << i << endl; if (i == 4) break; else continue; } system("pause"); return 0; }
运行结果:
在if else结构中break和continue可以作用于for循环
相关文章推荐
- for循环中break与i++执行
- POJ 1458 Common Subsequence(最长公共子序列)
- UIButton设置title在下,image在上
- Android studio运行时报错finished with non-zero exit value 1
- Building a Space Station--最小生成树
- Ext.ComponentQuery.query()
- Longest Consecutive Sequence
- UUID
- 02-线性结构3 Pop Sequence
- UIScrollView、UIPageControl、NSTimer知识点回顾
- POJ 1679 The Unique MST 【用次小生成树验证最小生成树是否唯一】
- UIL的使用
- Mac环境安装 pip lxml requests
- Ext中关于Ext.QuickTips.init()的使用
- String StringBuilder StringBuffer 对比
- UIL的源码分析
- MUI上传头像
- easyui添加/删除
- HDOJ-1242 Rescue
- Presto中Queue的使用总结