#include <iostream>
using namespace std;
int main() {
string password;
cin >> password;
int count[26] = {0};
for (char c : password) {
count[c - 'A']++;
}
int n = 0;
for (int i = 0; i < 26; i++) {
if (count[i] > 0) {
n++;
}
}
char s[n];
int count_2[n];
int list = 0;
for (int i = 0; i < 26; i++) {
if (count[i] > 0) {
s[list] = 'A' + i;
count_2[list] = count[i];
list++;
}
}
for (int i = 0; i < n; i++) {
cout << s[i];
}
cout << endl;
return 0;
}
程式顯而易見非常簡單
應該不用多說了