64,654
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int In = 0;
cin >> In;
string * stb = new string[In];
vector<string> vect;
for (int i = 0; i < In; i++)
{
fflush(stdin);
getline(cin, stb[i]);
vect.push_back(stb[i]);
}
sort(vect.begin(), vect.end());
vector<string>::iterator it;
for (it = vect.begin(); it != vect.end(); it++)
{
cout << *it << endl;
}
return 0;
}