Although this question is a question, it can make programmers realize how to convert characters and numbers.
In addition, we have a good understanding of the forward and backward orders of arrays.
Code:
1 #include <stdio.h> 2 #include <string.h> 3 #include <ctype.h> 4 #define MAXN 350 5 char a[MAXN]; 6 char outp[2][2][10]={" ","* "," ","*"}; 7 int main() 8 { 9 int i,j,max;10 int c[27];11 memset(c,0,sizeof(c));12 // input13 for(j = 0;j < 4;j ++)14 { 15 fgets(a,sizeof(a),stdin);16 for(i = 0;i < strlen(a);i ++)17 if(isalpha(a[i]))18 c[a[i]-'A']++;19 }20 //printf("%d\n",c[0]);21 22 // find max23 max = c[0];24 for(i = 0;i < 26;i ++)25 if(c[i]>max)max = c[i];26 27 // printf28 for(i = 0;i < max;)29 {30 for(j = 0;j < 26;j ++)31 {32 if(c[j]<max)printf("%s",outp[j/25][0]);33 else printf("%s",outp[j/25][1]);34 }35 printf("\n");36 max--;37 }38 // output"ABC..."39 printf("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\n");40 return 0;41 }