#include<stdio.h>
main()
{
int s,a=0,b=0,c=0,d=0;
scanf("%2d",&s);
if((s>=65&&s<=91)||(s>=97&&s<=123));
a=a+1;
else if(s="");
b=b+1;
else if(s<=1&&s>=9);
c=c+1;
else
d=d+1;
printf(%d%d%d%d,abcd);
}
帮忙看看哪错了,谢谢!!!!!
还是不对“c(8) : warning C4047: '=' : 'int ' differs in levels of indirection from 'char [1]'”
追答#include
main()
{
int a=0,b=0,c=0,d=0;
char s;
scanf("%c",&s);
while(s!='\n')
{
if(((s>='a')&&(s='A')&&(s='0'&& s<='9')
c=c+1;
else
d=d+1;
scanf("%c",&s);
}
printf("字符%d 空格%d 数字%d 其他%d",a,b,c,d);
}
老兄,说实话,你错的有点多……我都快重写了……