编译执行都没有有关问题,但是结果没有输出

编译执行都没有问题,但是结果没有输出!
RT,求帮忙看看哪里出现逻辑错误!
#include <iostream>
#include <list>
#include <vector>
#include <string>
using namespace std;
int main()
{
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;

int wordNumbers = 0; //单词个数
string::size_type wordLenth = 0, maxLenth = 0, minLength = 0;
string separators(" \t:,\v\f\n\r"); //分隔符
vector<string> sLongestWord;//最长单词
  vector<string> sShortestWord;//最短单词
string::size_type startPos = 0, endPos = 0;
  string word;

//***********************************while*******************************************
while ((startPos = sentence.find_first_not_of(separators, endPos) != string::npos))
{ //找到一个单词的起始位置

++wordNumbers; 
//找到单词

endPos = sentence.find_first_of(separators, startPos);
//找到一个单词的结束位置

if (endPos == string::npos)
//如果相等,说明这已经是最后一个单词
{
wordLenth = sentence.size() - startPos;
}
else
{
wordLenth = endPos - startPos;
}
  word.assign(sentence.begin() + startPos, sentence.begin() + startPos + wordLenth);
startPos = sentence.find_last_not_of(separators, endPos);

if (wordNumbers == 1)
{
maxLenth = minLength = wordLenth;
sLongestWord.push_back(word);
sShortestWord.push_back(word);
}
else
{
if (wordLenth > maxLenth)
{
maxLenth = wordLenth;
sLongestWord.clear(); //清空容器
sLongestWord.push_back(word);
}
else if (wordLenth == maxLenth)
sLongestWord.push_back(word);
else if (wordLenth < minLength)
{
minLength = wordLenth;
sShortestWord.clear(); //清空容器
sShortestWord.push_back(word);
}
else if (wordLenth == minLength)
{
sShortestWord.push_back(word);
}
}
 
}//***********************************End while*******************************************

  //**********************************************************
cout << "单词个数:" << wordNumbers << endl;
cout << "最长单词个数为: " << sLongestWord.size() 
<< " 分别为:";
for (vector<string>::iterator iter = sLongestWord.begin();
iter != sLongestWord.end(); ++iter)
{
cout << *iter << " ";
}
cout << endl;
  //**********************************************************
   
//**********************************************************
cout << "最短单词个数为:" << sShortestWord.size()
<< " 分别为:";
for (vector<string>::iterator iter = sShortestWord.begin();
iter != sShortestWord.end(); ++iter)
{
cout << *iter << " ";
}
cout << endl;
  //**********************************************************
return 0;
}

------解决方案--------------------
while 里面死循环了。。。
------解决方案--------------------
结论就是你的算法有问题。
------解决方案--------------------
加断点,单步调试