此函数可读取整行,包括前导和嵌入的空格,并将其存储在字符串对象中。 getline 函数如下所示: getline(cin, inputLine); 而 getline(cin,s,’>’) 表示当遇到输入>的时候输入终止。