>>195
unsigned class_count[5];
class_count[!!isalpha(c) + !!isdigit(c) * 2 + !!isspace(c) * 3 +
(c == '\n') * 4]++;