#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
bool isShorter(const string &s1,const string &s2)
{
return s1.size()<s2.size();
}
bool GT6(const string &s)
{
return s.size()>=6;
}
string make_plural(size_t n,const string &word,const string &ending)
{
return(n==1)? word:word + ending;
}
int main()
{
// TODO: 请用您自己的代码替换下面的示例代码。
vector<string> words;
string word;
while(cin>>word)
{
words.push_back(word);
}
sort(words.begin(),words.end());
vector<string>::iterator it =words.begin();
for(;it!=words.end();++it)
cout<<*it<<endl;
vector<string>::iterator end_unique=unique(words.begin(),words.end());
words.erase(end_unique,words.end());
stable_sort(words.begin(),words.end(),isShorter);
vector<string>::size_type wc =count_if(words.begin(),words.end(),GT6);
cout<<wc<<""<< make_plural(wc,"word","s")<<"6 character or longer"<<endl;
return 0;
}
能运行但是为什么没有输出结果啊 我不停的输入单词 可是没有运行的结果啊