下面程序的功能是统计文本data.txt中各种大写字母的个数,将统计结果存放在数组count中,(字母'A'的个数存入count[0]中,字母'B'的个数存入count[1]中……依次类推),输出统计结果,一行输出5个。
#include<stdio.h>
#include<stdlib.h>
void main()
{FILE *fp;
static int count[26]={0};
int i;
char ch;
if()
{printf("can not open the file!\n");
exit(0);
}
while(!feof(fp))
{;
if(ch>='A'&&ch<='Z') count[_________]++;
}
for(i=0;i<26;i++)
{if(i%5==0) printf("\n");
printf("count[%d]=%-5d",i,count[i]);
}
fclose(fp);
}
ch-'A'
if(ch>='A'&&ch<='Z') count[ch-'A']++;
只有一空?