控制流 / 控制流中断

#include <iostream>
using namespace std;

int firstMatchValue = -1;
int array1[] {123};
int array2[] {234};

for (int value1 : array1) {
    for (int value2 : array2) {
        if (value1 == value2) {
            firstMatchValue = value2;
            goto stop;
        }
    }
}
stop:
//firstMatchValue is 2

cout << firstMatchValue;