The ||
doesn't quite mean what you think it means. The correct approach is:
if (yesno != 'Y' && yesno != 'N') { ...
This evaluates each side of the &&
independently, and the result is true if both sides are true.
Note that
if (yesno != 'Y' || yesno != 'N') { ...
will always be true because any given character is either not Y or it is not N. This is probably not what you want.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…