Break和Continue的区别
#include<iostream>
using namespace std;
int main()
{
int x=0;
for(x=0;x<10;x++)
{
if(x==3)
break;
else
cout << x;
}
cout << endl;
for(x=0;x<10;x++)
{
if(x==3)
continue;
else
cout << x;
}
return 0;
}运行结果
012 012456789
在运行到break后,循环被直接跳出,而continue是直接进行下一次循环



