c语言 有一篇文章,共有3行文字,每行有80个字符。要求分别统计出其中英文大写字

如题所述

第1个回答  2011-04-20
#include<stdio.h>
main()
{char str[3][80]={ };//你可以初始化
int i,j,num=0;
for(i=0;i<3;i++)
for(j=0;j<80;j++)
if(str[i][j]>'A'&&str[i][j]<'Z')
num++;// 统计大写字母的个数
}本回答被提问者采纳
第2个回答  推荐于2018-03-01
char *str;
int num=0;
...
while( *str !='\0')
{
if( *str >='A' && *str<='Z')
num++;
str++;
}本回答被网友采纳