#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
char c;
int sum1,sum2,sum3,sum4;
sum1=sum2=sum3=sum4=0;
while((c=getchar())!='\n')
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
sum1++;
}
else if(c>='0'&&c<='9')
{
sum2++;
}
else if(c==' ')
{
sum3++;
}
else
{
sum4++;
}
}
cout<<sum1<<" "<<sum2<<" "<<sum3<<" "<<sum4<<endl;
return 0;
}
字符串《字符统计》
最新推荐文章于 2024-08-28 14:35:43 发布