| ||||||||||
| 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 | |||||||||
fent怎么都看不出来错,ACM太狠了,高手指点一下吧#include<iostream.h>
void main()
{
char m,a[4][72];
int b[26]={0};
char c[26]={'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'};
for(int i=0;i<4;i++)
cin.getline(a[i],72);
for(i=0;i<4;i++)
{
for(int j=0;j<72;j++)
{
m=a[i][j];
if(m>='A'&&m<='Z')
{
int t=m-65;
b[t]++;
}
}
}
int max=b[0];
for(i=0;i<26;i++)
{
if(b[i]>max)
max=b[i];
}
for( i=max;max>=0;max--)
{
for(int j=0;j<26;j++)
{
if(b[j]>=max+1)
cout<<"*";
else
cout<<" ";
cout<<' ';
}cout<<endl;
}
for(i=0;i<26;i++)
cout<<c[i]<<' ';
cout<<endl;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator