Run ID:11778

提交时间:2021-05-17 17:17:03

#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<<" "<<c<<" "<<b<<" "<<d<<endl; return 0; }