C++ 对string进行排序

  • Post author:
  • Post category:其他


 1 #include<iostream>
 2 #include<string>
 3 #include<algorithm>
 4 using namespace std;
 5 
 6 int main(void)
 7 {
 8     string colorBrick;
 9     cin >> colorBrick;
10     
11     sort(colorBrick.begin(), colorBrick.end());
12 
13     cout<<colorBrick<<endl;
14     system("pause");
15     return 0;
16 }    

转载于:https://www.cnblogs.com/zxj9487/p/10903105.html