| ||||||||||
| 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 | |||||||||
水题,不解释#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator