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 |
高手帮帮忙啊`````郁闷!!第一次碰到Output Limit Exceed,求救!!#include<iostream> #include<string> #define MAX 108 using namespace std; typedef struct zim{ int sign[MAX]; }zimu; zimu zz[65]; int temp=-1; int kk[MAX]={0}; char last[MAX]; void com(string s) { for(int i=0;i<s.size();kk[s[i]-65]++,i++) if(s[i]<='Z'&&s[i]>='A') zz[s[i]-65].sign[kk[s[i]-65]]=1; } void getlast() { for(int j=0;j<26;j++) if(kk[j]>temp) temp=kk[j]; for(int te=temp;te>=0;te--) for(int i=25;i>=0;i--) if(zz[i].sign[te]==1) { last[te]=(char)(i+65); break; } } void output() { for(int i=0;i<=temp;i++) { for(int k=0;k<=(int)last[temp-i]-65;k++) { if(k!=0) cout<<' '; if(zz[k].sign[temp-i]==1) cout<<"*"; else cout<<" "; } cout<<" "<<endl; } cout<<'A'; for(i=66;i<=90;i++) cout<<' '<<(char)i; cout<<endl; } void main() { while(1) { string s; for(int i=0;i<4;i++) { getline(cin,s); com(s); } getlast(); output(); } } //哪们大哥能帮帮忙啊!!加我QQ52203336,或者直接把程序改好,发到我邮箱里 GFVTK@126.COM 先谢谢了 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator