Run ID:78354
提交时间:2024-06-18 19:33:10
#include<iostream> #include<cstring> using namespace std; int main(){ string x; int a=0,b=0,c=0,d=0; getline(cin,x); for(int i=0;i<x.size();i++){ if(x[i]>='a'&&x[i]<='z'||x[i]>='A'&&x[i]<='Z') a++; else if(x[i]>='0'&&x[i]<='9') c++; else if(x[i]==' ') b++; else d++; } cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl; return 0; }