请在 下方输入 要搜索的题目:

输入一行字符,统计出其中的英文字母、空格、数字和其他字符的个数。

输入一行字符,统计出其中的英文字母、空格、数字和其他字符的个数。

发布时间:2025-10-16 18:26:50
推荐参考答案 ( 由 快搜搜题库 官方老师解答 )
联系客服
答案:#include int main(void){char c;int blank, digit, letter, other;c = getchar();blank = digit = letter = other = 0;while(c != '\n'){if(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')letter ;else if(c >= '0' && c <= '9')digit ;else if(c == ' ')blank ;elseother ;c = getchar();}printf("letter = %d, blank = %d, digit = %d, other = %d\n", letter, blank, digit, other);return 0;}
专业技术学习
专业技术学习
搜搜题库系统