在Python中,我可以做到:
char_choice = input("What is your character choice? Please enter A, W or D.")
while char_choice.lower() not in ["a", "w", "d"]:
char_choice = input("You entered an incorrect character. Please try
again:")
在C ++中,有没有一种方法可以重复第2行?我已经尝试了很多种方式,但它不起作用,所以我知道我做错了什么:
char classificationCode;
cin >> classificationCode;
while (classificationCode != "b" || classificationCode != "B" || classificationCode != "d" || classificationCode != "D" || classificationCode != "w" || classificationCode != "W");