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 n,i,j; char s[10],b[10]; scanf("%d",&n); while(n--) { int A=0,B=0; scanf("%s%s",s,b); for(i=0;i<4;i++) for(j=0;j<4;j++) if(s[i]==b[j]) { B++; if(i==j) A++; } printf("%dA%dB\n",A,B-A); }return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator