sort by test

#include<algorithm>\x0d
#include<iostream>\x0d
#include<vector>\x0d
using namespace std;int main(){int n,i,m;cin>>n;vector<int>a;for(i=0;i<n;i++){cin>>m;a.push_back(m);}sort(a.begin(),a.end());for(i=n-1;i>-1;i--){cout<<a[i];if(i>0)cout<<" ";}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page