goto
:跳至标记处继续执行程序
首先来个范例,简单入个门
#include <iostream> using namespace std; int main() { int getInput; do { cin >> getInput; if (getInput % 2 == 1) { cout << "输入的是单数" << endl; goto BREAK; cout << "会从这里接着执行吗?" << endl; } } while ( getInput != 404); BREAK: { cout << "结束" << endl; return 0; } return 0; }