#include <stdio.h>
#include <conio.h>

 
int main(int argc, char * argv[])
{

    char ch;
    int letters = 0, space = 0, digit = 0, others = 0;
    printf("请输入一组字符串:\n");
    while((ch=getchar())!='\n')
    {
        if(ch>'a' && ch < 'z' || ch >'A' && ch< 'Z')
            letters++;
        else if(ch == ' ')
            space++;
        else if(ch>='0' && ch<='9')
            digit++;
        else
            others++;
        
    }
    printf("英文个数为:%d,空格为:%d,数字为:%d,其他字符:%d", letters, space, digit, others);
    getch();

    return 0;
}

相关文章:

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