Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

请帮助~为什么 "WA"

Posted by kcm1700 at 2006-03-05 19:55:38 on Problem 2629
请帮助~为什么 "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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator