Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: 38408

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

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-06 01:42:29

#include <bits/stdc++.h>
using namespace std;
int main(){
    string word;
    vector<char> num ;
    string answer ;
    cin >> word;
    for (int i = 0; i < word.length(); i++)
    {
        num.push_back(word[i]);
    }
    sort(num.begin(),num.end());
    for (int i = 0; i < word.length(); i++)
    {
        if(answer.find(num[i])==string::npos){
            answer += num[i];
            answer += " ";
        }
    }
    answer.pop_back();
    cout << answer ;   
}