我正在尝试创建一个聊天机器人(总初学者),我找不到错误。
错误是“ std :: cout <<'\ n您有任何宠物吗?”的错误;“ std :: cout <<'hello'<<名称<<'! \ n'; | std :: cout <<'您几岁了?';
**
#include <iostream>
#include <string>
int main(){
std::string name;
std::string age;
std::string pets;
std::string flower;
getline(std:: cin, name);
std::cout << 'hello' << name << '!\n' ;
std::cout << 'How old are you?';
getline(std:: cin, age);
std::cout << "OOh, you're "<< age ;
std::cout << ' \n You got any pets?';
getline(std:: cin, pets);
std::cout << "I love " << pets;
std::cin.ignore();
}
**