下列选项中,作用是“立即退出本层循环”的是( )
while
break
continue
for
下列选项中,作用是“跳过本次循环”的是( )
while
break
continue
for
下方while循环程序,共循环( )次。
#include <iostream>
using namespace std;
int main (){
int a = 10;
while( a > 20 )
{
cout << "a 的值:" << a << endl;
a++;
}
return 0;
}
无限次
10次
20次
不满足条件,跳过循环
下方while循环程序,共循环()次。
#include <iostream>
using namespace std;
int main (){
int a = 10;
while( a < 20 )
{
cout << "a 的值:" << a << endl;
a++;
if (i == 15){
continue;
}
}
return 0;
}
无限次
10次
9次
5次
下方while循环程序,共循环( )次。
#include <iostream>
using namespace std;
int main (){
int a = 10;
while( a < 20 )
{
cout << "a 的值:" << a << endl;
a++;
}
return 0;
}
无限次
10次
20次
不满足条件,跳过循环
下方while循环程序,共循环( )次。
#include <iostream>
using namespace std;
int main ( ){
int a = 10;
while( a < 20 )
{
cout << "a 的值:" << a << endl;
a++;
if (i == 15){
break;
}
}
return 0;
}
无限次
10次
5次
9次
下方while循环程序,共循环( )次。
#include <iostream>
using namespace std;
int main (){
int a = 10;
while( a != 20 )
{
cout << "a 的值:" << a << endl;
a++;
}
return 0;
}
无限次
10次
20次
不满足条件,跳过循环