='0' ch ='A' ch ='a' ch 【字符分析统计】。字符分析统计。" />

字符分析统计


字符分析统计

文章插图
#include#include using namespace std;int main() { char ch = '`'; int num = 0,let = 0,spa = 0,oth = 0; scanf ("%c",&ch); while (ch!=(char)10) { if (ch>='0' && ch<='9') num++; else if (ch>='A' && ch<='Z') let++; else if (ch>='a' && ch<='z') let++; else if (ch==' ') spa++; else oth++; scanf ("%c",&ch); } printf ("letters=%d\n",let); printf ("numbers=%d\n",num); printf ("space=%d\n",spa); printf ("others=%d\n",oth); system ("pause"); return 0;}
【字符分析统计】

    推荐阅读