参考 https://blog.csdn.net/upc_xbt/article/details/53305962
注意:
#include
#include
#include
using namespace std;
int main()
{
int num=0;
cin>>num;
string str;
vector word;
while(cin>>str)
{
word.push_back(str);
}
sort(word.begin(),word.end());
for(auto iter=word.cbegin();iter!=word.cend();iter++)
{
cout<<*iter<
sort函数不能用cbegin(),即如下是错误的:
sort(word.cbegin(),word.cend());