字串的连接最长路径查找C++
字串的连接最长路径查找
http://www.nowcoder.com/questionTerminal/5af18ba2eb45443aa91a11e848aa6723
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; int main() { int n; vector<string> s; string tmp; while(cin>>n) { for(int i=0;i<n;i++) { cin>>tmp; s.push_back(tmp); } sort(s.begin(),s.end()); } for(auto x:s) cout<<x<<endl; return 0; }