#include <stdio.h> #include<malloc.h> #include<string.h> int main() { char* str = (char*)malloc(1000 * sizeof(char)); gets(str); int i; int yw = 0, kg = 0, sz = 0, other = 0; int len = strlen(str); for (i = 0; i < len; i++) { if ((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z')) yw++; else if (str[i] >= '0' && str[i] <= '9') sz++; else if (str[i] == ' ') kg++; else other++; } printf("%d\n", yw); printf("%d\n", kg); printf("%d\n", sz); printf("%d\n", other); }