酷酷的大魔王701 2021-11-12 16:35 采纳率: 0%
浏览 32

输入3行字符统计其中的字母,数字,空格和其他字符的个数。(strcat()) 字符串数组

输入3行字符统计其中的字母,数字,空格和其他字符的个数。(strcat())
字符串数组

  • 写回答

2条回答 默认 最新

  • 从善若水 优质创作者: 信息安全技术领域 2021-11-12 16:41
    关注
    
    #include <stdio.h>
    int main()
    {
        char s[100];
        int letter=0,space=0 ,digit=0,other=0;
        gets(s);
        statistic(s,&letter,&space ,&digit,&other);
        gets(s);
        statistic(s,&letter,&space ,&digit,&other);
        gets(s);
        statistic(s,&letter,&space ,&digit,&other);
        
        printf("lettle:%d,digit:%d,space:%d,other:%d\n",letter,digit,space,other);
        
        return 0;
    }
    
    评论

报告相同问题?

问题事件

  • 创建了问题 11月12日