- continue的作用:使用continue语句来终止循环的当前迭代。(注意与break的区别,break会跳出循环,而continue只会跳出当前循环,而后会继续执行循环条件判断)
# include<iostream>
# include<process.h>
using namespace std;
int main(){
string word;
const int min_size = 4;
while(cin>>word){
if(word.size() < min_size)
continue;
cout<<word<<endl;
}
}//当输入的word长度小于4时不输出,大于等于四时输出