sdut oj 1219 字符统计1#include <stdio.h>
#include <string.h>
int main()
{
    char str[100010];
    int i, x, a, b, c, d;
    while(gets(str))
    {
        x = strlen(str);
        a = 0; b = 0; c = 0; d = 0;
        for(i = 0; i <= x -1; i++)
        {
            if((str[i] >= 65 && str[i] <= 90) || (str[i] >= 97 && str[i]<= 122))
                a++;
            else if(str[i] >= 48 && str[i] <= 57)
                b++;
            else if(str[i] == 32)
                c++;
            else
                d++;
        }
        printf("%d %d %d %d\n", a, b, c, d);
    }
    return 0;
}

相关文章:

  • 2022-12-23
  • 2021-08-14
  • 2021-08-19
  • 2022-12-23
  • 2021-08-12
  • 2021-07-25
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2021-10-24
  • 2021-04-27
  • 2021-11-01
  • 2021-08-07
  • 2021-12-30
  • 2021-06-18
  • 2022-12-23
相关资源
相似解决方案