本站首页    管理页面    写新日志    退出


«July 2025»
12345
6789101112
13141516171819
20212223242526
2728293031


公告

☆★☆★☆★☆★☆★☆
生活的点点记录,以及一些体会...........

喜欢是淡淡的爱,爱是深深的喜欢.

时间会见证一切.......................

欢迎大家指出错误,共同进步..........

期待中..............................

☆★☆★☆★☆★☆★☆


我的分类(专题)

日志更新

最新评论

留言板

链接

世纪音频

 

 


Blog信息
blog名称:
日志总数:162
评论数量:312
留言数量:0
访问次数:940213
建立时间:2005年5月17日




[读书笔记]c收藏
文章收藏

oceanblue 发表于 2005/10/20 10:01:08

输入3*8的一个数组,要求分别统计出其中的英文大写字母,小写字母,数字,空格以及其他字符的个数... #include <stdio.h>#include <string.h>#include<conio.h>void main(){    char str[3][8];int i,j,big,small,num,space,other;big=small=num=space=other=0;printf("enter 3 rows and 8 lines characters:\n");for(i=0;i<3;i++)gets(str[i]);for(i=0;i<3;i++)for(j=0;j<strlen(str[i])+1;j++)if(str[i][j]>='A'&&str[i][j]<='Z')big++;else   if(str[i][j]>='a'&&str[i][j]<='z')small++;else   if(str[i][j]>='0'&&str[i][j]<='9')num++;else if(str[i][j]==' ')space++;else  other++;printf("big=%3d,small=%3d,num=%3d,space=%3d,other=%3d",    big,small,num,space,other);//getch();}


阅读全文(2317) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.031 second(s), page refreshed 144749929 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号