输入一行字符-分别统计出其中字母、空格、数字和其他字符的个数

上传人:ni****g 文档编号:560241583 上传时间:2023-08-19 格式:DOCX 页数:1 大小:10.81KB
返回 下载 相关 举报
输入一行字符-分别统计出其中字母、空格、数字和其他字符的个数_第1页
第1页 / 共1页
亲,该文档总共1页,全部预览完了,如果喜欢就下载吧!
资源描述

《输入一行字符-分别统计出其中字母、空格、数字和其他字符的个数》由会员分享,可在线阅读,更多相关《输入一行字符-分别统计出其中字母、空格、数字和其他字符的个数(1页珍藏版)》请在金锄头文库上搜索。

输入一行字符,分别统计出其中字母、空格、数字和其他字符的个数。#includeint letter,digit,space,others;void main() void count(char); char text80; printf(Please string:n); gets(text); printf(string:n); puts(text); letter=0; digit=0; space=0; others=0; count(text); printf(letter:%d,digit:%d,space:%d,others:%dn,letter,digit,space,others);void count(char str) int i; for(i=0;stri!=0;i+) if(stri=a&stri=A&stri=0&stri=9) digit+; else if(stri=32) space+; else others+;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 幼儿/小学教育 > 小学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号