using namespace std;
int main()
{
char c;
int el=0,sp=0,nu=0,other=0;
while(cin.get(c))
{
if(c=='\n')
break;
if((c>='A' && c<='Z')||(c>='a' && c<='z'))
el++;
else if(c>='0'&&c<='9')
nu++;
else if(c==' ')
sp++;
else
other++;
}
cout<<"英文字母個數(shù)="<<el<<endl<<"數(shù) 字 個 數(shù) ="<<nu<<endl<<"空 格 字 數(shù) ="<<sp<<endl<<"其他字符個數(shù)="<<other<<endl;
system("pause");
return 0;
}
望采納!