#include #include int lencln(char const * sin){ int len = 0; for (int i = 0; sin[i] != '\0'; i++) { if(sin[i] >= 'A' && sin[i] <= 'Z' || sin[i] >= 'a' && sin[i] <= 'z'){ len++; } } return len; } char * clean(char const * sin){ int j = 0; char * str_cln = NULL; str_cln = (char*)malloc(sizeof(char) * (lencln(sin) + 1)); if(!str_cln){ fprintf(stderr, "Out of memory!\n"); exit(-10); } for (int i = 0; sin[i] != '\0'; i++) { if(sin[i] >= 'A' && sin[i] <= 'Z' || sin[i] >= 'a' && sin[i] <= 'z'){ str_cln[j] = sin[i]; j++; } } return str_cln; } int main(){ char sin[101]; scanf(" %100[^\n]s", sin); char * strout = clean(sin); printf("%s\n", strout); free(strout); strout = NULL; return 0; }