小红的幸福


私信TA

用户名:905579539

访问量:7313

签 名:

等  级
排  名 3336
经  验 1833
参赛次数 0
文章发表 12
年  龄 0
在职情况 学生
学  校 花花的幸福学校
专  业

  自我简介:

解题思路:





注意事项:





参考代码:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
 int i,m;
 int letter=0;
 int space=0;
 int num=0;
 int other=0;
 char str[100];
 gets(str);
 m=strlen(str);
 
 for(i=0; i<m; i++)
 {
  if((str[i]>=65&&str[i]<=90)||(str[i]>=97)&&(str[i]<=122))
   letter++;
  else if(str[i]==' ')
   space++;
  else if(str[i]>=48&&str[i]<=57)
   num++;
  else
   other++;

 }
 printf("%d %d %d %d\n",letter,space,num,other);
 return 0;
}


 

0.0分

0 人评分

  评论区