fork download
  1. #include <bits/stdc++.h>
  2. #define fo(name) if (fopen(name".inp", "r")){ freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout); }
  3. #define fast_io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  4. #define ll long long
  5. using namespace std;
  6. bool check(string a,string b){
  7. return a+b>b+a;
  8. }
  9. void solve(){
  10. string n;
  11. vector<string> a;
  12. while (cin>>n) a.push_back(n);
  13. sort(a.begin(),a.end(),check);
  14. for (ll i=0;i<a.size();i++) cout<<a[i];
  15. }
  16. int main(){
  17. fast_io
  18. fo("numcon");
  19. ll t=1; // cin>>t;
  20. while (t--) solve();
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty