答案:
#include <iostream>
using namespace std;
int main()
{
char c;
int letter=0,number=0,space=0,others=0;
cout<<"Please input c:";
while((c=getchar())!='\n')
{
if(c>='A'&&c<='Z'||c>='a'&&c<='z')
letter++;
else if(c>='0'&&c<='9')
number++;
else if(c==' ')
space++;
else
others++;
}
cout<<"the letter of c is:"<<letter<<endl;
cout<<"the number of c is:"<<number<<endl;
cout<<"the space of c is:"<<space<<endl;
cout<<"the other of c is:"<<others<<endl;
return 0;
}