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 denganliang at 2011-03-28 19:38:23 on Problem 3589
#include <stdio.h>
int main(){
	int i,j,k,n,a,b;
	char s[5],t[5];
	s[4]=t[4]='\0';
	scanf("%d",&n);
	for(i=0;i<n;i++){
		a=b=0;
		scanf("%s %s",s,t);
		for(j=0;j<4;j++)
		    if(s[j]==t[j]) a++;
		for(j=0;j<4;j++){
			for(k=0;k<4;k++)
			if(s[j]==t[k]&&j!=k)
			 b++;
			}
		printf("%dA%dB\n",a,b);	
		}
	
	
	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