此代码不比较输入。其中有什么问题?

时间:2020-12-19 05:17:19

标签: c++

/ 这是头文件 如果我尝试获取输入,它不会比较它。/

bool read_boolean(字符串提示) {

string result;
result = read_string(prompt);
string to_lowercase(const string &text);
if (result == "yes" or "y")
{
    write_line("Value is updated");
}
else if (result == "no" or "n")
{
    write_line("false");

}

return 0;

}

0 个答案:

没有答案