Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: JRomsponCH

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-01 14:51:12

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

int main() {
    string str;
    cin>>str;
    for (int i = 0; i < (int)str.length(); i++) {
        int mn = i;
        for (int j = i+1; j < (int)str.length(); j++) {
            if (str[mn] > str[j]) {
                mn = j;
            }
        }
        int temp = str[i];
        str[i] = str[mn];
        str[mn] = temp;
    }
    for (int i = 0; i < (int)str.length(); i++) {
        if (str[i] != str[i-1]) {
            cout<<str[i]<<" ";
        }
    }
}