sort函数对string型 按字典序排序

#include<iostream>  #include<algorithm>  #include<cstring> using namespace std; int main() {  string str("hello world");  sort(str.begin(),str.end());
    cout<<str; return 0;
}