Orz 4楼,你手指不累?
#include<iostream.h>
#include<string.h>
int main()
{
char* a=new char[50];
int i,m,sum1=0,sum2=0,sum3=0;
cout<<"please enter!"<<endl;
cin>>a;
m=strlen(a);
for(i=0;i<m;i++)
{
if(a[i]>=48&&a[i]<=59)
sum1++;
if(a[i]>=65&&a[i]<=90)
sum2++;
if(a[i]>=97&&a[i]<=122)
sum3++;
}
cout<<"数字共有"<<sum1<<"个"<<endl;
cout<<"大写字母共有"<<sum2<<"个"<<endl;
cout<<"小写字母共有"<<sum3<<"个"<<endl;
return 0;
}