Run ID:11772
提交时间:2021-05-17 17:12:27
#include<bits/stdc++.h> using namespace std; string s; int a,b,c,d; int main() { getline(cin,s); for(int i=0;i<s.size();++i) { if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')) a++; else if(s[i]>='1'&&s[i]<='9') c++; else if(s[i]==' ') b++; else d++; } cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl; return 0; }