Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: MyYammGods
Problemset: เรียงสตริง
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-06 00:19:35
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
char word[31];
int alphabet;
int upper[26] = {0};
int lower[26] = {0};
cin >> word;
for(int i=0;i<strlen(word);i++){
if(word[i]>='A'&&word[i]<='Z'){
upper[word[i]-'A'] = 1;
}else if(word[i]>='a'&&word[i]<='z')
lower[word[i]-'a'] = 1;
}
for(int i=0;i<26;i++){
if(upper[i]==1){
alphabet = i + 'A';
cout << (char)(alphabet) << " ";
}
}for(int i=0;i<26;i++){
if(lower[i]==1){
alphabet = i + 'a';
cout << (char)(alphabet) << " ";
}
}
}