输入一行字符,分别统计出其中英文字母、数字、空格和其他字符的个数。
Sample Input
aklsjflj123 sadf918u324 asdf91u32oasdf/.';123
Sample Output
23 16 2 4
#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
char c;
int A=0,B=0,C=0,D=0;
while((c=getchar())!='\n')
{
if(c>='a'&&c<='z'||c>='A'&&c<='Z')
A++;
else if(c==' ')
B++;
else if(c>='0'&&c<='9')
C++;
else
D++;
}
cout<<A<<" "<<C<<" "<<B<<" "<<D<<endl;
}