#include<iostream> using namespace std; int main() { int count; for(count = 1;count<=10;count++) { if(count == 5) break; cout << count << " " ; } system("pause >> cout "); return 0; } //break语句在while do...while for switch语句中执行时,立刻使程序控制退出 //这些语句。程序继续执行这些语句之后的第一条语句。break语句的常见用法 //要么是提前离开循环,要么用于跳过switch语句的剩余部分