Files
OI-source/history_source/ccf 基础篇/U2/2.4.2.cpp
2023-08-03 09:22:52 +08:00

25 lines
616 B
C++

#include<iostream>
using namespace std;
int main()
{
int num[26],b;
char sr;
for(int i=0;i<26;i++) num[i]=0;
while((sr=getchar())!='\n') if(sr>='A'&&sr<='Z') num[sr-'A']++;
while((sr=getchar())!='\n') if(sr>='A'&&sr<='Z') num[sr-'A']++;
while((sr=getchar())!='\n') if(sr>='A'&&sr<='Z') num[sr-'A']++;
while((sr=getchar())!='\n') if(sr>='A'&&sr<='Z') num[sr-'A']++;
b=num[0];
for(int i=0;i<26;i++) if(num[i]>b) b=num[i];
for(int i=b;i>=0;i--)
{
for(int j=0;j<26;j++)
if(num[j]>i) cout<<"* ";
else cout<<" ";
cout<<endl;
}
for(int i=0;i<26;i++) cout<<char(i+'A')<<" ";
cout<<endl;
return 0;
}