解决方法: 1. #include <string.h>这是C语言字符数组的操作函数,不是C++ 的string类,改变cout的相应输出,智能输出字符 2. #include <string.h>改为#include <string>