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> #include <memory> using namespace std; int main() { char string[4][72]; int count[26],i,t,j; memset(count,0,26*sizeof(int)); for(i = 0;i<4; i++) { cin.getline(string[i],72); } for(i=0;i<(72*4);i++) { t=*(string[0]+i); if(t>='A'&&t<='Z') count[t-'A']++; } t=0; for(i=0;i<26;i++) { if(count[i]>t) t=count[i]; } for(i=0;i<26;i++) count[i]=t-count[i]; for(i=0;i<t;i++) { for(j=0;j<26;j++) { if(count[j]>0) cout<<" "; else cout<<"* "; count[j]--; } cout<<endl; } for(i=0;i<25;i++) cout<<(char)('A'+i)<<" "; cout<<'Z'; cout<<endl; return 0; } 郁闷啊,我已经三次被拒了……那位大虾指点迷津?谢谢啦…… Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator