Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: nunos

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-09-28 23:19:25

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string txt;
    cin >> txt;

    for(int i=0;i<txt.size();i++){
        for(int j=0;j<txt.size()-i;j++){
            if(int(txt[j]>int(txt[j+1]))){
                swap(txt[j],txt[j+1]);
            }
        }
    }
    for(int i=0;i<txt.size()+1;i++){
        if(txt[i]!=txt[i-1]){
            cout << txt[i] << " ";
        }
    }
    return 0;
}