#include <iostream> using namespace std;void main( ) { int target=245; int a; cout<<"欢迎您玩这个无聊的猜数游戏"<<endl; cout<<"您的目标是猜中我想好的数"<<endl; cout<<"请输入第一次猜的数:";_input: cin>>a; if (a>target) { cout<<"您刚才输入的数太大了!"<<endl; cout<<"再猜一次:"; goto _input; } else if (a<target) { cout<<"您刚才输入的数太小了!"<<endl; cout<<"再猜一次:"; goto _input; }else cout<<"恭喜你,猜对了!"<<endl; }
std::cin.clear()std::cin >> a;