Submission

Status:

[-SSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: Newton

Problemset: เรียงสตริง

Language: cpp

Time: 0.003 second

Submitted On: 2026-10-01 12:59:37

#include <bits/stdc++.h>
using namespace std;

int main(){
	int len;
	string text;
	char store;
	bool check;
	cin >> text;
	len = text.length();
	
	do{
		check = true;
		for(int i = 1; i < len; i++){
			if (int(text[i]) < int(text[i-1])){
				store = text[i];
				text[i] = text[i-1];
				text[i-1] = store;
				check = false;
			}
		}
	}while(check == false);
	
	for(int i = 0; i < len; i++){
		cout << text[i] << " ";
	}
	return 0;
}