请问这个程式不用got該怎麽修改呢?
#include <iostream>#include <cstdlib>
#include <time.h>
using namespace std;
int main()
{
int x,y;
srand(time(NULL));
x=(rand()%(100-1+1)+1);
label:
cout<<"請輸入一個數字: ";
cin >>y;
if(y == x)
cout <<"答對了"<<endl;
if(y > x)
{
cout <<"太大了"<<endl;
goto label;
}
if(y < x)
{
cout <<"太小了"<<endl;
goto label;
}
system("PAUSE");
return 0;
}
我只會用goto,請大神指點一下
謝謝!