欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: c語言 統計不同類型字符數 [打印本頁]

作者: liuda    時間: 2015-1-22 02:46
標題: c語言 統計不同類型字符數
#include<stdio.h>//統計不同類型字符數
void main()
{char c;
        int e=0,s=0,n=0,o=0;//這樣輸入是錯誤的:e=s=n=o=1,為什么呢?
printf("please input random characteristics,use enter to end the string\n");
for(;(c=getchar())!='\n';)//斜杠好像被我打反了
{
if((c>=65&&c<=90)||(c>=97&&c<=122))
e++;
else if((c>=48&&c<=57))
n++;
else if(c==32)
s++;
else
o++;
}
printf("the number of english characteristic is %d\n",e);
printf("the number of  space is %d\n",s);
printf("the number of number is %d\n",n);
printf("the number of other characteristics is %d\n",o);
}






歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1