cin读取字符串(char[] / string)都会遇到空白(空格 /制表符 /换行符)停止读入。 此时读取一行字符串输入可以用cin.getline(s, length); 需要注意的时,读入的字符串长度只能为length-1;