c语言题,急需答案!

[复制链接]
查看11 | 回复0 | 2007-3-22 11:31:31 | 显示全部楼层 |阅读模式
#include void main(){ char new[]; inti,x=0,y=0,z=0,o=0; /**x为英文字符数y为空格字符数z数字个数,o其他字符树***/ printf("输入一个文本\n"); scanf("%s",new); for(i=0;new;i++) {
if(new>='1'&&new='a'&&new='A'&&newvoid main(){int i=0,chars=0,nums=0,spaces=0,others=0;char a[50];/*用来接收输入的字符串*/printf("请输入一行字符:\n");gets(a);while(a!='\0'){if ((a>='A' && a='a' && a='0' && a>pstr; curchar = pstr[0]; int curindex = 1; while(curchar != '\0') { if (curchar >= 65 && curchar = 128 || curchar = 48 && curchar <= 57) //0-9 numcount++; else if (curchar == 32) //空格 spacecount++; else othercount++; curchar = pstr[curindex++]; } totalcount = charcount + chinesecount + numcount + spacecount + othercount; cout<<"总数:"<<totalcount<<" 英文字符:"<<charcount<<" 中文字符"<<chinesecount <<" 数字:"<<numcount<<" 空格:"<<spacecount<<" 其它:"<<othercount; }//我转载的参考资料:http://zhidao.baidu.com/question/5760725.html

已赞过已踩过<这里有现成的答案:http://hanlin.hbu.cn/personal/gbz/xiti.htm
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行