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 |
想一想,aeee beed 结果是应该是ee.In Reply To:请帮助~为什么 "WA" Posted by:kcm1700 at 2006-03-05 19:55:38 > 请帮助~为什么 "WA" > > #include <stdio.h> > char a[1003],b[1003]; > int acnt[27],bcnt[27]; > int main(){ > int i,j; > while(scanf("%s%s",a,b)!=EOF){ > for(i=0;i<26;i++)acnt[i]=0; > for(i=0;i<26;i++)bcnt[i]=0; > for(i=0;a[i];i++)acnt[a[i]-'a']++; > for(i=0;b[i];i++)bcnt[b[i]-'a']++; > for(i=0;i<26;i++){ > for(j=0;j<acnt[i]&&j<bcnt[i];j++){ > printf("%c",i+'a'); > } > } > printf("\n"); > } > return 0; > } > Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator