#include<iostream>
using namespace std;
int main()
{
    char c[100];
    int i,zf=0,sz=0,qt=0;
    cin.getline(c,100);
    for(i=0;c[i]!='\0';i++)
        {
        if(c[i]>='A'&&c[i]<='Z'||c[i]>='a'&&c[i]<='z')
            zf=zf+1;
                else if(c[i]>='0'&&c[i]<='9')
                    sz=sz+1;
                      else
                        qt=qt+1;
        }
    cout<<"字符个数:"<<zf<<endl;
    cout<<"数字个数:"<<sz<<endl;
    cout<<"其它字符个数:"<<qt<<endl;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: