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 |
回过头来看这道题。。。才知道过得惊险!!!主要是数据太水~~~不然就WA。。。#include<iostream> using namespace std; int main() { int n,i,j,k,l,num1,num2; char a[5],b[5]; cin>>n; for(l=1;l<=n;l++) { cin>>a>>b; num1=0;num2=0; for(i=0;i<4;i++) for(j=0;j<4;j++) if(a[i]==b[j]) num1++; for(k=0;k<4;k++) if(a[k]==b[k]) num2++; cout<<num2<<'A'<<num1-num2<<'B'<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator