CiNpbmNsdWRlICZsdDtzdGRpby5oJmd0OwojaW5jbHVkZSAmbHQ7Y3R5cGUuaCZndDsKCnZvaWQgY291bnRfY2hhcmFjdGVycygpIHsKICAgIGNoYXIgdGV4dFsxMDBdOwogICAgcHJpbnRmKCZxdW90OyBFbnRlciBudW1iZXI6ICZxdW90Oyk7CiAgICBmZ2V0cyh0ZXh0LCAxMDAsIHN0ZGluKTsKCiAgICBpbnQgY2hhcl9jb3VudFsyNl0gPSB7MH07CiAgICBmb3IgKGNoYXIgKnAgPSB0ZXh0OyAqcDsgcCsrKSB7CiAgICAgICAgaWYgKGlzYWxwaGEoKnApKSB7CiAgICAgICAgICAgIGNoYXJfY291bnRbdG9sb3dlcigqcCkgLSAnYSddKys7CiAgICAgICAgfQogICAgfQoKICAgIHByaW50ZigmcXVvdDsgRW50ZXIgbnVtYmVyOlxuJnF1b3Q7KTsKICAgIGZvciAoaW50IGkgPSAwOyBpICZsdDsgMjY7IGkrKykgewogICAgICAgIGlmIChjaGFyX2NvdW50W2ldKSB7CiAgICAgICAgICAgIHByaW50ZigmcXVvdDslYzogJWRcbiZxdW90OywgaSArICdhJywgY2hhcl9jb3VudFtpXSk7CiAgICAgICAgfQogICAgfQp9CgppbnQgbWFpbigpIHsKICAgIGNvdW50X2NoYXJhY3RlcnMoKTsKICAgIHJldHVybiAwOwp9
#include <stdio.h>
#include <ctype.h>
void count_characters() {
char text[100];
printf(" Enter number: ");
fgets(text, 100, stdin);
int char_count[26] = {0};
for (char *p = text; *p; p++) {
if (isalpha(*p)) {
char_count[tolower(*p) - 'a']++;
}
}
printf(" Enter number:\n");
for (int i = 0; i < 26; i++) {
if (char_count[i]) {
printf("%c: %d\n", i + 'a', char_count[i]);
}
}
}
int main() {
count_characters();
return 0;
}