查德泰森


私信TA

用户名:YYM111112113

访问量:934

签 名:

等  级
排  名 103998
经  验 64
参赛次数 0
文章发表 1
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:





注意事项:





参考代码:

#include<stdio.h>

#include<ctype.h>

int main(void)

{

char all[100]; 

int i=0;

int _ch=0;//字母数

int _num=0;//数字数

int _space=0;//空格数

int _other=0;//其他字符数

printf("input:");

gets(all);

while(all[i])

{

if(isalpha(all[i]))

_ch++;

else if(isdigit(all[i]))

_num++;

else if(isblank(all[i]))

_space++;

else 

_other++;

i++;

}

printf("%d %d %d %d\n",_ch,_num,_space,_other);

return 0;


 

0.0分

0 人评分

  评论区