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

作业3.3

 

相关文章:

  • 2022-01-04
  • 2021-06-08
  • 2021-11-19
  • 2021-05-22
  • 2021-06-19
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
猜你喜欢
  • 2021-07-21
  • 2021-06-26
  • 2021-08-23
  • 2021-08-12
  • 2021-11-26
相关资源
相似解决方案