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

怎么可能会出错?

Posted by sunpy at 2008-08-02 17:15:12 on Problem 3589 and last updated at 2008-08-02 17:15:32
#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;
}

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