新人求助,大家帮我检查下这个程序吧。。。
#include<stdio.h>void main()
{
char a[3][80];
int i,j,up_case,low_case,numeric,blankspace,other;
up_case=low_case=numeric=blankspace=other=0;
for(i=0;i<3;i++)
gets(a[i]);
for(i=0;i<3;i++)
for(j=0;j<80;j++)
{
if(a[i][j]>='A'&&a[i][j]<='Z')
{
up_case++;
continue;
}
if(a[i][j]>='a'&&a[i][j]<='z')
{
low_case++;
continue;
}
if(a[i][j]>='0'&&a[i][j]<='9')
{
numeric++;
continue;
}
if(a[i][j]='')
{
blankspace++;
continue;
}
other++;
}
printf("the number of uppercase is %d\n",up_case);
printf("the number of lowercase is %d\n",low_case);
printf("the number of numeric is %d\n",numeric);
printf("the number of blank space is %d\n",blankspace);
printf("the number of other form is %d\n",other);
}
other的值总是不正确,大神们帮忙看看哪里出了问题
[ 本帖最后由 绿茶盖儿 于 2011-9-4 23:11 编辑 ]