编程问题

[复制链接]
查看11 | 回复0 | 2009-9-29 16:37:24 | 显示全部楼层 |阅读模式
#include #define MAXSTERLEN 255 #include void main() {int a=0,b=0,c=0,d=0;char str[81]; int i,num=0,word=0;char e;printf("please input the string:\n");gets(str);for(i=0;i='a'&&str='A'&&str='0'&&str #define MAXSTERLEN 255 #include void main() {int a=0,b=0,c=0,d=0;char str[81]; int i,num=0,word=0;char e;printf("please input the string:\n");gets(str);for(i=0;i='a'&&str='A'&&str='0'&&str<='9') b++;
else if(str==' ') c++;
else d++;} } for(i=0;(e=str)!='\0';i++){ if(e==' ')
word=0; else if(word==0) {
word=1;
num++; }}printf("字母个数%d\n",a);printf("数字个数%d\n",b); printf("空格个数%d\n",c);
printf("总的字符个数%d\n",d); }
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行