#include <iostream> using namespace std; void func(bool b) { if (b==true){ goto label; } else { goto label1; } label: cout << "真" << endl; return; label1: cout << "假" << endl; return; } int main() { /* goto语句:可以让CPU跳转到任何一条语句去执行 语法:goto 标签 */ func(1); return 0; }