// Sort letters in a string
// Date 08/10/2018
// By Ben

#include <iostream>

using namespace std;
using std::cout;
using std::endl;
using std::cin;

void SortLetters(string &source){
	int i = 0;
	int j = 0;
	int len = source.length();
	//Sort source
	for (i = 0; i < len; i++){
		for (j = i + 1; j < len; j++){
			if (source[i] > source[j]){
				//Swap items in source
				swap(source[i], source[j]);
			}
		}
	}
}

int main(int argc, char *argv[]){
	string s0 = "afbgedc";
	//Sort letters in string
	SortLetters(s0);
	//Output sorted string.
	std::cout << s0.c_str() << endl;

	system("pause");
	return 0;
}