C语言OJ项目参考(2569)统计字符串种类

时间:2022-08-02 08:54:45

2569: 统计字符串种类

Description
用指针编写一个程序,输入字符串后,统计其中各种字符的个数,输出其中大小写字母,数字,以及其他字符的个数。
主函数已经给出,请编写统计字符种类函数。
Input
一串字符串
Output
该字符串中大小写字母,数字,以及其他字符的个数,最后输出总字符串长度。
Sample Input**
I play LOL for 3 years.
Sample Output
4
12
1
6
23
HINT

#include <stdio.h>
int main()
{
char str[100];
gets(str);
char *ptr=str;
void fuction(char *);
fuction(ptr);
return 0;
}

参考解答: