#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    char str[50];
    int i=0,n=0,m=0,x=0,l=0;
    cout<<"输入字符串:";
    gets(str);
    while(str[i]!='\0')
    {
        if(str[i]>='0'&&str[i]<='9') n++;
        if(str[i]>='a'&&str[i]<='z') m++;
        if(str[i]>='A'&&str[i]<='Z') x++;
        if(str[i]=='A') l++;
        i++;
    }

    cout<<"其中的数字个数是: "<<n<<endl;
    cout<<"其中的小写字母个数是: "<<m<<endl;
    cout<<"其中的大写字母个数是: "<<x<<endl;
    cout<<"其中A的次数是:"<<l<<endl;
    return 0;
}


相关文章:

  • 2022-01-01
  • 2021-08-06
  • 2021-06-12
  • 2021-11-08
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案