资源预览内容
第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+;
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号