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],a[27]; int b[26],max; for(int i=0;i<4;i++) cin.getline(ch[i],73); for(i=0;i<26;i++) { a[i]='A'+i; } for(i=0;i<26;i++) { b[i]=0; } for(i=0;i<4;i++) for(int j=0;j<73;j++) if(ch[i][j]>='A'&&ch[i][j]<='z') b[ch[i][j]-'A']++; max=b[0]; for(i=0;i<26;i++) if(b[i]>max) max=b[i]; while(max) { for(i=0;i<26;i++) { if(b[i]<max&&b[i]>0) cout<<" "; else if(b[i]==0) continue; else cout<<"* "; } cout<<endl; max--; } for(i=0;i<26;i++) { if(b[i]!=0) cout<<a[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