#include<stdio.h>int main(void){ int i,letter=0,digit=0,other=0; char ch; printf("input 20 characters:"); for(i=1;i<=20;i++){ ch=getchar(); if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z') letter++; else if(ch>='0'&&ch<='9') digit++; else other++; } printf("letter=%d,digit=%d,other=%d",letter,digit,other); return 0;}
#include<stdio.h>intmain(void){inti,letter=0,digit=0,other=0;charch;printf("input20characters:");for(i=1;i<=20;i++){ch=getchar();if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z')letter++;elseif(ch>='0'&&ch<='9')digit++;elseother++;}printf("letter=%d,digit=%d,other=%d",letter,digit,other);return0;}