落花四月


私信TA

用户名:LSYC

访问量:31889

签 名:

等  级
排  名 533
经  验 4336
参赛次数 2
文章发表 34
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:

看见这一题想到自己当初实验室考核的时候,

那个是随堂测试,当时的我并没有做出来,

时间过的好快,珍惜当下



注意事项:


答案输出的时候中间有空格 还有就是字母大小写



参考代码:

#include<stdio.h>

int main()

{

int space,digit,other,letter;

char ch;

letter=space=digit=other=0;

while((ch=getchar())!='\n')

{

if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z')

letter++;

else if(ch>='0'&&ch<='9')

digit++;

else if(ch==' ')

space++;

else

other++;

}

printf("%d %d %d %d",letter,digit,space,other);

return 0;

}



愿你能够一直快乐着!

 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区