出于某种原因,这个非常简单的 while 循环一直在无限循环。也许我已经盯着这个太久了,或者犯了一些非常明显的愚蠢错误。有人可以帮我修复代码吗?我尝试输入“ste”,但它一直给我无效的输出。
while (type1 != "nor" || type1 != "fir" || type1 != "wat" || type1 != "ele" || type1 != "gra" || type1 != "ice" || type1 != "fig"|| type1 != "poi" || type1 != "gro" || type1 != "fly" || type1 != "psy" || type1 != "bug" || type1 != "roc" || type1 != "gho" || type1 != "dra" || type1 != "dar" || type1 != "ste" || type1 != "fai" || type1 != "n/a")
{
cout << "Invalid type. Re-enter type." << endl;
cin >> type1;
}