| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
水水更健康#include<cstdio>
#include<cctype>
int cnt[27];
int main()
{
char c;
int max=0,cur;
while((c=getchar())!=EOF)
{
if(!isalpha(c)) continue;
cnt[c-'A']++;
}
for(int i=0;i<26;i++) if(cnt[i]>max) max=cnt[i];
while(max--)
{
cur=25;
while(cnt[cur]<=max) cur--;
for(int i=0;i<cur;i++)
if(cnt[i]>max) printf("* ");
else printf(" ");
printf("*\n");
}
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");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator