#include <iostream.h>
void main()
{
int option;
cin>>option; while((option!=1) && (option!=2))
{
cout<<endl;
cout<<"Sorry that is not an option. Please try again."<<endl;
cout<<endl;
cout<<"Press 1 To see "<<endl;
cout<<"Press 2 To play"<<endl;
cin>>option;
}
}输入数字(0-9)正常运行
可是若输入的是字母则程序一直在输出,好像cin<<option不起作用。
请问为什么?