我自己试着做了个 看看吧 希望有所帮助
#include<stdio.h>
#include<string.h>
int main(void)
{
char array[100];
int i=0,len=0,count=0,count1=0,count2=0,count3=0;
gets(array);
len=strlen(array);
for(i=0;i<len;i++){
if(array[i] >='a' && array[i] <= 'z' || array[i] >= 'A' && array[i] <= 'Z')
count++;
else if(array[i]==' ')
count1++;
else if(array[i]>= '0' && array[i]<= '9')
count2++;
else
count3++;
}
printf("the number of letter is%i\n the number of blank is%i\n the number of number is%i\n the number of others is%i\n",count,count1,count2,count3);
getch();
return 0;
}
|| 是shift+'\'
[此贴子已经被作者于2006-8-19 16:58:26编辑过]