2015-07-30
展开全部
#include "stdio.h"
main()
{char c;
intletters=0,space=0,digit=0,others=0;
printf("pleaseinput some characters\n");
while((c=getchar())!='\n')
{
if(c>='a'&&c<='z'||c>='a'&&c<='z')
letters++;
else if(c=='')
space++;
elseif(c>='0'&&c<='9')
digit++;
else
others++;
}
printf("all in all:char=%d space=%ddigit=%d others=%d\n",letters,
space,digit,others);
}
main()
{char c;
intletters=0,space=0,digit=0,others=0;
printf("pleaseinput some characters\n");
while((c=getchar())!='\n')
{
if(c>='a'&&c<='z'||c>='a'&&c<='z')
letters++;
else if(c=='')
space++;
elseif(c>='0'&&c<='9')
digit++;
else
others++;
}
printf("all in all:char=%d space=%ddigit=%d others=%d\n",letters,
space,digit,others);
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个不会,但百度上找到些:http://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=baidu&wd=黄金矿工c代码&rsv_pq=84518e270000b090&rsv_t=4848i9zGQhOak0CA7Sk98thTL%2BOxc%2Fm6m4zzrNj2M9K84v2do6Yu0IEIhNA&rsv_enter=0&rsv_sug3=5&inputT=4165&rsv_sug4=4929
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询