#include <iostream> #include <string> int main() { std::string userInput; std::cout << "请输入单词 apple 或 orange:"; std::cin >> userInput; if(userInput == "apple") { std::cout << "正确答案是苹果。" << std::endl; } else if(userInput == "orange") { std::cout << "正确答案是橙子。" << std::endl; } else { std::cout << "输入错误,请输入单词 apple 或 orange。" << std::endl; } return 0; } [2024-11-01 06:55:55 | AI写代码神器 | 309点数解答]