/*已知有如下 string 对象:
9.39:
string line1 = "We were her pride of 10 she
named us:";
string line2 = "Benjamin, Phoenix, the
Prodigal"
string line3 = "and perspicacious pacific
Suzanne";
string sentence = line1 + ' ' + line2 + ' ' +
line3;
编写程序计算 sentence 中有多少个单词,并指出其中
最长和最短的单词。如果有多个最长或最短的单词,则
将它们全部输出。*/
int main(void)
{
string line1 = "We were her pride of 10 she named us : ";
string line2 = "Benjamin, Phoenix, the Prodigal";
string line3 = "and perspicacious pacific Suzanne";
string sentence = line1 + ' ' + line2 + ' ' + line3;
cout<<sentence.c_str()<<endl;
int num = 0, count = 0;