为什么我的"智力"变量加5?

Mat*_*son 5 c++

if (checkForRoll == "intellect" && checkForRoll == "Intellect") {//checks for intellect
        intellect = intellect + 5;
    } else if (checkForRoll == "strength" && checkForRoll == "Strength") {
        strength = strength + 5;
    }
    cout << intellect;
Run Code Online (Sandbox Code Playgroud)

当我执行此操作时,intellect int不会添加5.为什么?

GWW*_*GWW 16

你要求你的字符串与智力和智力相等,这是不可能的.将"和"(&&)更改为"或"(||).