输入一行字符串,要求统计其中字母,空格,数字以及其他字符的数目

Q: 输入一行字符串,要求统计其中字母,空格,数字以及其他字符的数目,要求用数组和指针两种形式。 A1: #include <stdio.h> int main() { char c; int l=0,s=0,n=0,other=0; printf(“请输入一行字符(以!结束):”); while ((c=getchar())!=’!’) { if (c >= ‘A’&&c <= ‘Z’ || c
相关文章
相关标签/搜索