有一篇文章,共有3行文字,每行有80个字符。要求分别统计其中英文大写字母、小写字母、数字、空格以及

有一篇文章,共有3行文字,每行有80个字符。要求分别统计其中英文大写字母、小写字母、数字、空格以及其他字符的个数。
c编程后运行结果及原程序截图。

我只能猜测,你的那个“<”写的有问题,你试试从下面的“<”复制粘贴过去。。。

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2018-02-22
#include <stdio.h>
int main()
{int i,j,upp,low,dig,spa,oth;
char text[3][80];
upp=low=dig=spa=oth=0;
for (i=0;i<3;i++)
{ printf("please input line %d:\n",i+1);
gets(text[i]);
for (j=0;j<80 && text[i][j]!='\0';j++)
{if (text[i][j]>='A'&& text[i][j]<='Z')
upp++;
else if (text[i][j]>='a' && text[i][j]<='z')
low++;
else if (text[i][j]>='0' && text[i][j]<='9')
dig++;
else if (text[i][j]==' ')
spa++;
else
oth++;
}
}
printf("\nupper case: %d\n",upp);
printf("lower case: %d\n",low);
printf("digit : %d\n",dig);
printf("space : %d\n",spa);
printf("other : %d\n",oth);
return 0;
}本回答被网友采纳
第2个回答  2015-06-17
OK特里库斯咯可口可乐路追问

yes iinformation very tasty

追答

铁十六局口如陌路

第3个回答  2015-06-17
采纳了吧追问

你知道我在说什么吗?

相似回答