C++ を学ぼうとしていて、基本的な I/O 計算機を作成することにしました。2 回目の getUserInput() までは正常に動作し、その後は自動的に 0 を入力して終了します。何が起こっているのか理解できません!
#include <iostream>
using namespace std;
int getUserInput() {                                        // Get user numbers
    cout << "Enter a number: " << endl;
    int userInputNumber;
    cin >> userInputNumber;
    return userInputNumber;
}
char getUserOper() {                                        // Get user math operator
    cout << "Enter a math operator: " << endl;
    int userInputOper;
    cin >> userInputOper;
    return userInputOper;
}
int doMath(int x, char oper, int y) {                       // Does math based on provided operator
    if(oper=='+') {
        return x + y;
    }
    if(oper=='-') {
        return x - y;
    }
    if(oper=='*') {
        return x * y;
    }
    if(oper=='/') {
        return x / y;
    }
    else {
        return 0;
    }
}
void printResult(int endResult) {                           // Prints end result
    cout << endResult;
}
int main() {
    int userInputOne = getUserInput();
    char userOper = getUserOper();
    int userInputTwo = getUserInput();
    printResult(doMath(userInputOne, userOper, userInputTwo) );
}