回复 8楼 吉野家
#include<stdio.h>
#define N 1000
main()
{
char a[N],b[N],c[N],d[N];
int
i,j,count[N],counta[N],countb[N],countc[N],countd[N],max = 0;
gets(a);
gets(b);
gets(c);
gets(d);
for(i = 0;i < 26;i++)
{
counta[i] = 0;
countb[i] = 0;
countc[i] = 0;
countd[i] = 0;
}
for(i = 0;i < 26;i++)
{
for(j = 0;a[j] != '\0';j++)
{
if(a[j] == i+65)
counta[i]++;
}
for(j = 0;b[j] != '\0';j++)
{
if(b[j] == i+65)
countb[i]++;
}
for(j = 0;c[j] != '\0';j++)
{
if(c[j] == i+65)
countc[i]++;
}
for(j = 0;d[j] != '\0';j++)
{
if(d[j] == i+65)
countd[i]++;
}
count[i] = counta[i]+countb[i]+countc[i]+countd[i];
if (count[i] > max)
max = count[i];
}
for ( i = 0; i < max;i++)
{
for(j = 0;j < 26;j++)
{
if(max - count[j] - i > 0)
printf("
");
else
printf("* ");
}
printf("\n");
}
for(i = 0;i < 26;i++)
{
printf("%c ",i+65);
}
printf("\n");
}