<分区>
我怀疑在这种情况下,C++ 中的 return 是如何工作的。一旦条件匹配并且我们需要返回值,循环会发生什么。
some function(){
for( )//outer loop with i and other values
{
for( )// inner loop with i and other values {
some condition using if which on match return a value val (call it x here)
return x;
}
}
return -1
}