C语言编译时提示出错,高手帮忙

来源:百度知道 编辑:UC知道 时间:2024/05/26 16:04:25
这是一个求三列80列文本中字符及数字个数的程序,但出错了,高手帮忙看看
#include<stdio.h>
void main()
{
int i,j,upp,low,number,space,other;
char text[3][80],(*p)[80];
upp=low=number=space=other=0;
p=text;
for(i=0;i<3;i++)
{
printf("请输入第%d行文本",i+1);
gets(p+i);
for(i=0;i<3;i++,p++)
for(j=0;j<80&&(*p+j)!='\0';j++)
{
if(*p+j>='A'&&*p+j<='Z')
upp++;
else if(*p+j>='a'&&*p+j<='z')
low++;
else if(*p+j==' ')
space++;
else if(*p+j>='0'&&*p+j<='9')
number++;
else other++;
}
printf("大写%d个\n",upp);printf("小写%d个\n",low);
printf("数字%d个\n",number);printf("空格%d个\n",space);
printf("其它%d个\n",other);
}
}

#include<stdio.h>
void main()
{
int i,j,upp,low,number,space,other;
char text[3][80],(*p)[80];
upp=low=number=space=other=0;
p=text;
for(i=0;i<3;i++)
{
printf("请输入第%d行文本",i+1);
gets( *(p+i) );
//for(i=0;i<3;i++,p++)
for(j=0;j<80&&*(*(p+i)+j)!='\0';j++)
{
if( *(*(p+i)+j) >='A'&&*(*(p+i)+j)<='Z')
upp++;
else if(*(*(p+i)+j) >= 'a'&&*(*(p+i)+j) <= 'z')
low++;
else if(*(*(p+i)+j) ==' ')
space++;
else if(*(*(p+i)+j) >='0' && *(*(p+i)+j) <='9')
number++;
else other++;
}
printf("大写%d个\n",upp);printf("小写%d个\n",low);
printf("数字%d个\n",number);printf("空格%d个\n",space);
printf("其它%d个\n",other);