#include using namespace std; int main() { string str; //因为题目要求可能存在空格 getline(cin, str); int a = 0, b = 0, c = 0, d = 0; for (int i = 0; i < str.size(); i++) { if (str[i] >= 'a' && str[i] <= 'z') a++; else if (str[i] >= 'A' && str[i] <= 'Z') a++; else if (str[i] == ' ') b++; else if (str[i] >= '0' && str[i] <= '9') c++; else d++; } cout << a << " " << b << " " << c << " " << d << endl; return 0; }