#include<stdio.h> #include<memory.h> int main() { char ch; int num[26], i; memset(num, 0, 26 * sizeof(int)); //初始化数组num while ((ch = getchar() != '\n')) //输入字符串 if (ch >= 'A' && ch <= 'Z') //是否是大写字母 num[ch - 'A']++; for (i = 0; i < 26; i++) { if (i % 9 == 0) printf("\n"); printf("%c(%d)", 'A' + i, num[i]); } printf("\n"); return 0; }
标签:26,ch,int,个数,大写字母,num,include,输入 From: https://www.cnblogs.com/blog-of-zhh/p/16837734.html