#include <iostream> using namespace std; int main() { string str; getline(cin, str); // a英文字母,b空格,c数字,d其他 int a = 0, b = 0, c = 0, d = 0; for (char ch:str){ if (isalpha(ch)){ ++a; }else{ if (ch == ' '){ ++b; }else{ if (isdigit(ch)){ ++c; }else{ ++d; } } } } cout << a << endl << b << endl << c << endl << d << endl; }