#include<iostream>
#include<Windows.h>
#include<string>
using namespace std;
int main()
{
string xq;
for (int i = 0; i < 3; i++)
{
cout << "同意第" << i + 1 << "个好友位" << endl;
cout << "你喜欢玩打野?" << endl;
cin >> xq;
if (xq != "yes")
{
continue;
}
cout << "打开WeGame吧!" << endl;
cout << "你要玩卡兹克吗?" << endl;
cin >> xq;
if (xq == "yes")
{
goto jungle;
}
}
system("pause");
return 0;
jungle: //标签,可以在本函数的任意位置,但不能跑到其他函数里
{
cout << "我最喜欢和野王双排了!" << endl;
system("pause");
return 0;
}
}
运行结果: