#include
using namespace std;
int main()
{
srting str; // First, declare a string.
sort(str.begin() , str.end()); // Then sort it by using this method. It is much more convenient.
cout << str << endl; // Last of all, print out the string.
}
how to sort a string in c++
#include
using namespace std;
int main(){
int n;
cin>>n;
string s;
cin>>s;
for(int i=0;is[j+1]) swap(s[j],s[j+1]);
}
}
cout<