Files
python/TangDou/LianXiTi50/7.cpp

21 lines
523 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include<bits/stdc++.h>
using namespace std;
int main() {
string str;
//<2F><>Ϊ<EFBFBD><CEAA>ĿҪ<C4BF><D2AA><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4>ڿո<DABF>
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;
}