Submission

Status:
[PPPPPPPPPP]

Score: 100

User: Dormon

Problemset: เรียงสตริง

Language: c

Time: 0.007 second

Submitted On: 2024-11-11 00:59:10

#include <stdio.h>

int cnt[60];

int hash(char c){
    if ('A' <= c && c <= 'Z') return c - 'A';
    return c - 'a' + 26;
}

int main()
{
    char a[30]; scanf("%s", a);
    for (int i = 0;a[i] != '\0';i++)
        cnt[hash(a[i])]++;
    for (char i = 'A';i <= 'Z';i++)
        if (cnt[hash(i)]) printf("%c ", i);
    for (char i = 'a';i <= 'z';i++)
        if (cnt[hash(i)]) printf("%c ", i);
}