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<iostream.h> void main() { char ch[4][73],letter[26]; int n[26],max; for(int i=0;i<4;i++) cin.getline(ch[i],73); for(i=0;i<26;i++) { letter[i]='A'+i; n[i]=0; } for(i=0;i<4;i++) for(int j=0;j<73;j++) if(ch[i][j]>='A'&&ch[i][j]<='z') n[ch[i][j]-'A']++; max=n[0]; for(i=0;i<26;i++) if(n[i]>max) max=n[i]; while(max) { for(i=0;i<26;i++) { if(n[i]<max) cout<<" "; else cout<<"* "; } cout<<endl; max--; } for(i=0;i<26;i++) cout<<letter[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