#include <cstdio> #include <cstring> using namespace std; bool isLow(char ch) { return ch>='a' && ch<= 'z'; } bool isUp(char ch) { return ch>='A' && ch<='Z'; } bool isEn(char ch) { return isLow(ch) || isUp(ch); } bool isSpace(char ch) { return ch == ' '; } bool isNumber(char ch) { return ch >= '0' && ch <= '9'; } int main() { char ch; int arr[4]; memset(arr, 0, sizeof(arr)); while (EOF != scanf("%c", &ch)) { if(ch == '\n') { for(int i=0; i<4; i++) { printf("%d\n", arr[i]); } memset(arr, 0, sizeof(arr)); } else if(isEn(ch)) { arr[0]++; } else if(isSpace(ch)) { arr[1]++; } else if(isNumber(ch)) { arr[2]++; } else{ arr[3]++; } } return 0; }