题目链接:https://nanti.jisuanke.com/t/T1957
算法特工队QQ群:979618872 (伸手党绕边,欢迎有良好基础的人加入)
ps:抄作业的不要进上面的群
//
// Created by Leo Lee on 2019/4/5.
//
#include <iostream>
#include <string>
#include <algorithm>
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]>=65&&str[i]<=90) || (str[i]>=97&&str[i]<=122))
a++;
else if(str[i]>=48 && str[i]<=57)
b++;
else if(str[i] == ' ')
c++;
else
d++;
}
cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
return 0;
}