搜索
首页 电脑/网络 软件

用C语言编写一个程序

用C语言编写一个程序:从键盘输入若干个字符,分别统计其中字母符号(区别大。小),数字字符和其他字符的

全部回答

2008-10-28

0 0

    #include #include void main() { int i=0,n=0,m=0,j=0,k=0; char str[100]; printf("please input one string。
    \n"); scanf("%s",str); printf("\n"); while(str[i]!='\0') { if(str[i]>='a'&&str[i]='A'&&str[i]='0'&&str[i]<='9')j++; else k++; i++; } printf("小写字母:%d\n",n); printf("大写字母:%d\n",m); printf("数字:%d\n",j); printf("其他:%d\n",k); }。
  

2008-10-30

189 0

楼上的scanf("%s",str);函数是以空格或回车为中止符的,建议换个

类似问题换一批

热点推荐

热度TOP

相关推荐
加载中...

热点搜索 换一换

电脑/网络
软件
程序设计
电脑装机
操作系统/系统故障
硬件
笔记本电脑
百度
互联网
反病毒
软件
软件
多媒体软件
系统软件
办公软件
网络软件
图像处理软件
举报
举报原因(必选):
取消确定举报