Submission
Status:
[PPPPPPPPPP]
Score: 100
User: Jokul
Problemset: เรียงสตริง
Language: c
Time: 0.001 second
Submitted On: 2025-03-04 19:37:59
#include<stdio.h>
#include<string.h>
int main() {
char a[31];
int length = 0;
int count[52] = {0};
scanf("%30s", a);
while (a[length] != '\0') {
length++;
}
for (int i = 0; i < length; i++) {
if (64<(a[i])<91||96<a[i]<123) {
if (a[i]<91) {
count[a[i] - 'A']++;
} else {
count[a[i] - 'a' + 26]++;
}
}
}
for (int i = 0; i < 26; i++) {
if (count[i] > 0) {
printf("%c ", i + 'A');
}
}
for (int i = 26; i < 52; i++) {
if (count[i] > 0) {
printf("%c ", i - 26 + 'a');
}
}
printf("\n");
return 0;
}