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

Re:怎么可能会出错?

Posted by yuhuafx at 2008-08-18 04:31:37 on Problem 3589
In Reply To:怎么可能会出错? Posted by:sunpy at 2008-08-02 17:15:12
> #include<stdio.h>
> 
> #define N 4
> 
> char a[N],b[N];
> 
> int main()
> {
> 	int testcase;
> 	scanf("%d",&testcase);
> 	while(testcase--)
> 	{
> 		int s=0,d=0;
> 		scanf(" %s %s",a,b);
> 		int i,j;
> 		for(i=0;i<N;i++)
> 			for(j=0;j<N;j++)
> 			{
> 				if(i==j&&a[i]==b[j])
> 					s++;
> 				else if(i!=j&&a[i]==b[j])
> 					d++;
> 			}
> 		printf("%dA%dB\n",s,d);
> 	}
> 	return 0;
> }

4444 4000
你的程序是返回1A3B吧?

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