#include <iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
    int n;
    cin>>n;
    int input;
    vector<int> v;
    while(cin>>input){
        v.push_back(input);
    }
    for(int i=0;i<n;i++){
        cout<<v[i]<<" ";
    }
    vector<string> s;
    for(int i=0;i<v.size();i++){
        s.push_back(to_string(v[i]));
    }
    cout<<"\n";
    string ans="";
    sort(s.begin(),s.end(),greater<string>());
    for(int i=0;i<s.size();i++){
        ans=ans+s[i];
    }
    cout<<ans<<"\n";
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: