Files
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

21 lines
523 B
C++

#include<bits/stdc++.h>
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;
}