cin input (input is an int) when I input a letter, instead of printing back incorrect once, it prints correct once then inc for the rest of the loop
问题 I'm making a multiplication practice program. As my title says, if I enter a letter into the console instead of a number, it will run off saying correct on the first one, but incorrect on the rest. Even if you're not touching the keyboard, it'll still spit out incorrect. ans = table * i; std::cout << table << " * " << i << " =" << std::endl; std::cin >> input; if(input == ans) { std::cout << "Correct! " << ans << std::endl; } else { std::cout << "Incorrect, the answer was " << ans << std: