Submission
Status:
[-SSSSSSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: Zsawova
Problemset: เรียงสตริง
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-14 20:29:08
//
// Created by ASUS on 13/10/2026.
//
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
int main() {
string input; cin >> input;
const unsigned long length = input.length();
vector<int> words;
for (int i = 0; i < length; i++) {
words.push_back(toupper(input[i]));
}
sort(words.begin(), words.end());
vector<char> letters;
for (int i = 0; i < length; i++) {
for (int j = 0; j < words.size(); j++) {
if ((static_cast<char>(words[i]) == input[j] || static_cast<char>(words[i]) == toupper(input[j]))) {
letters.push_back(input[j]);
}
}
}
set <char> let(letters.begin(), letters.end());
cout << endl;
for (char val : let) {
cout << val << " ";
}
return 0;
}