请问一下这个程序有一个问题出现在哪啊??求解,急急急!!
#include<stdio.h>#defineN80voidmain(){chars[80];inti,letter,number,space,other,length...
#include <stdio.h>
#define N 80
void main()
{
char s[80];
int i, letter,number,space,other,length;
length= letter=number=space=other= 0;
printf("请输入一个字符串:\n");
gets(s);
for(i=0;s[i]!='\0';i++)
{length ++;
if(c>='a'&&c<='z') letter++;
else if(c>='A'&&c<='Z') letter++;
else if(c>='0'&&c<='9') number++;
else if(c>=' ') space++;
else other++;
if(s[i]>='a'&&s[i]<='z')
s[i]=s[i]-32;
}
printf("\n字符串长度:\n");
printf("length=%d\n",length);
printf("letter=%d\n,number=%d\n,space=%d\n,other=%d\n",letter,number,space,other);
printf("处理后的字符串:\n");
puts(s);
} 展开
#define N 80
void main()
{
char s[80];
int i, letter,number,space,other,length;
length= letter=number=space=other= 0;
printf("请输入一个字符串:\n");
gets(s);
for(i=0;s[i]!='\0';i++)
{length ++;
if(c>='a'&&c<='z') letter++;
else if(c>='A'&&c<='Z') letter++;
else if(c>='0'&&c<='9') number++;
else if(c>=' ') space++;
else other++;
if(s[i]>='a'&&s[i]<='z')
s[i]=s[i]-32;
}
printf("\n字符串长度:\n");
printf("length=%d\n",length);
printf("letter=%d\n,number=%d\n,space=%d\n,other=%d\n",letter,number,space,other);
printf("处理后的字符串:\n");
puts(s);
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询