#include<stdio.h> int main(void) { int blank,digit,other,letter; char ch; int i; blank=digit=other=letter=0; printf("Enter 15 个字符:"); for(i=1;i<=15;i++){ ch=getchar( ); if((ch>='A'&&ch<='Z')||(ch>='a'&&ch<='z')) letter++; else if(ch>='0'&&ch<='9') digit++; else if(ch>=' '&&ch<=' ') blank++; else other++; } printf("blank=%d,digit=%d,letter=%d,other=%d ",blank,digit,letter,other); return 0; }