题目描述

输入

输出

样例输入

样例输出

源代码
#include<stdio.h>
int main()
{
char c;
int Character = 0, number = 0, spaces = 0, others = 0;
while ((c = getchar()) != '\n')
{
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
Character++;
else if (c >= '0' && c <= '9')
number++;
else if (c == ' ')
spaces++;
else
others++;
}
printf("%d %d %d %d\n", Character, number, spaces, others);
return 0;
}
关于这题


本文介绍了一个简单的C语言程序,该程序能够统计输入文本中字符、数字、空格和其他符号的数量,并提供了完整的源代码实现。
445

被折叠的 条评论
为什么被折叠?



