关于goto的编程,下面哪里出错了?要怎么改!
#include <iostream.h>int main()
{
cout<<"Do you want a random number?(Y/N)"<<endl;
char chAnswer;
cin>>chAnswer;
if (chAnswer == 'N')
goto DONE;
else
{
int nRandom=rand();
cout<<"The random number created by rand() function is "<<nRandom<<endl;
}
DONE:
cout<<"Thank you !!"<<endl;
return 0;
}