AC

秋风拂过发梢  •  4个月前


include

include

include

using namespace std; int main () {

string a;
char *p;
int d=0,x=0,s=0,q=0,z=0;
getline (cin,a);
p = &a[0];	
for (int i=0;i<a.size();i++)
{
	if (*p>='A'&&'Z'>=*p)
	{
		d++;
	}
	else if (*p>='a'&&'z'>=*p)
	{
		x++;
	}
	else if (*p>='0'&&*p<='9')
	{
		s++;
	}
	else
	{
		q++;
	}
	p++;
}
z = d+x+s+q;
cout<<d<<" "<<x<<" "<<s<<" "<<q<<" "<<z;
return 0;

}


评论:

请先登录,才能进行评论