2019-11-12 08:36
University of Bristol C++ hanfu:#include<iostream>
#include<sstream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(void)
{
string str;
while(getline(cin, str)){
vector<string> p;
string tmp;
stringstream ss;
ss << str;
while(ss >> tmp)
p.push_back(tmp);
sort(p.begin(),p.end());
for(int i=0; i<p.size()-1; i++)
cout << p[i] << ' ';
cout << p[p.size()-1] << endl;
}
return 0;
}
0 点赞 评论 收藏
分享
关注他的用户也关注了: