在“继续”或“中断”之后会执行哪个语句?
for(int i = 0; i < count; ++i)
{
// statement1
for(int j = 0; j < count; ++j)
{
//statement2
if(someTest)
continue;
}
//statement3
}
for(int i = 0; i < count; ++i)
{
// statement1
for(int j = 0; j < count; ++j)
{
//statement2
if(someTest)
break;
}
//statement3
}
最佳答案
继续:++j
然后如果 j < count
然后 statement2
否则 statement3
中断:statement3
关于C++ 继续与中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6368141/