题解 | #图片整理#
图片整理
http://www.nowcoder.com/practice/2de4127fda5e46858aa85d254af43941
#include<iostream> #include<string> using namespace std; int main() { string input; while(cin>>input) { int length = input.length(); for(int i=0; i<length; i++) { for(int j=0; j<length-i-1;j++) { if(input[j] < input[j+1]) { swap(input[j], input[j+1]); } } cout<<input[length-i-1]; } cout<<endl; } return 0; }