#include
void main()
{ int c;
int letter=0,digit=0,space=0,other=0;
printf("Please input a string:\n");
while ((c=getchar())!='\n')//加上括号,赋值是从右到左,要不然每次C都为1
{//加上{}
if ((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
letter++;
else if (c>='0'&&c<='9')
digit++;
else if (c==' ')//把=改为==,=为赋值,每次if语句都成立
space++;
else
other++;
}//加上{}
printf("letter=%d, ",letter);
printf("digit=%d, ",digit);
printf("space=%d, ",space);
printf("other=%d\n",other);
}
#include
# define M 10
main()
{int a[M],i,j,n;
for(i=0;i
n=i=M-1;
while(i>=0)
{ if(*(a+i)==*(a+i-1))
{for(j=i;j<=n;j++)
*(a+j-1)=*(a+j);
n--;;
}
i--;}
for(i=1;i<=n+1;i++)
{printf("%4d",*(a+i-1));
if(i%4==0)
printf("\n");}
printf("\n");
}