无论输入是否正确,下面的代码都不起作用。如果输入正确,则 if 语句由于某种原因仍会执行。任何快速的建议都会有所帮助。
char status;
cout<<"Please enter the customer's status: ";
cin>>status;
if(status != 'P' || 'R')
{
cout<<"\n\nThe customer status code you input does not match one of the choices.\nThe calculations that follow are based on the applicant being a Regular customer."<<endl;
status='R';
}