好吧,既然你只求结果,那我就给你结果、、
vector<string> students;
int nums;
cin>>nums;
string str;
for(int i=0;i<nums;i++)
{
cin>>std;
students.push_back(str);
}
sort(students.begin(),students.end());
copy(students.begin(),students.end(),ostream_iterator<string>(cout," "));