Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: uraniumconsumer
Problemset: เรียงสตริง
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-03 16:09:59
#include <bits/stdc++.h>
using namespace std;
int main(){
int count[52] = {0};
string arranged = "";
string word;
cin >> word;
for(int i = 0; i < word.length(); i++){
if(word[i] >= 'A' and word[i] <= 'Z'){
int incount = word[i] - 'A';
count[incount]+=1;
}
else if(word[i] >= 'a' and word[i] <= 'z'){
int incount = word[i] - 'a' + 26;
count[incount]+=1;
}
}
for(int i = 0; i < 26; i++){
if(count[i] > 0){
cout << char(65 + i) << ' ';
}
}
for(int j = 26; j < 52; j++){
if(count[j] > 0){
cout << char(71 + j) << ' ';
}
}
}