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

    return 0;

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-08-04
  • 2021-12-13
  • 2022-12-23
相关资源
相似解决方案