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 |
请帮助~为什么 "WA"请帮助~为什么 "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